私はRails 3.0.3を使用していますが、Ruby-mysqlからmysql2に変更しましたが、今は次のエラーがあります:Rails 3.0.3と "互換性のない文字エンコーディング"エラー
incompatible character encodings: ASCII-8BIT and UTF-8
私はこれについてどこでも読んでいますが、私はそれを修正することはできません。
application.rb:
config.encoding = "utf-8"
database.ymlの:
development:
adapter: mysql2
encoding: utf8
database: rails3_development
username: root
password:
host: localhost
宝石:
specs:
abstract (1.0.0)
actionmailer (3.0.3)
actionpack (3.0.3)
activemodel (3.0.3)
activerecord (3.0.3)
activeresource (3.0.3)
activesupport (3.0.3)
arel (2.0.7)
bcrypt-ruby (2.1.4)
builder (2.1.2)
erubis (2.6.6)
i18n (0.5.0)
jquery-rails (0.2.6)
mail (2.2.15)
mime-types (1.16)
**mysql2 (0.2.6)
orm_adapter (0.0.4)
paperclip (2.3.8)
polyglot (0.3.1)
rack (1.2.1)
rack-mount (0.6.13)
rack-test (0.5.7)
rails (3.0.3)
railties (3.0.3)
rake (0.8.7)
thor (0.14.6)
treetop (1.4.9)
tzinfo (0.3.24)
warden (1.0.3)
will_paginate (3.0.pre2)
他の検索者の場合:mysql2およびblobデータ型を使用している場合は、常にバイナリを返します。 BLOBフィールドを 'text'データ型に変更するだけです。エンコードを維持します。 –