Hey
I’m having some encoding compatibility problems with my rails app
(development mode). The database (mysql 5.0.22) uses UTF8, so everything
from db that is printed on my webpages gets corrupted.
So I googled and found
http://wiki.rubyonrails.org/rails/pages/HowToUseUnicodeStrings where it
says to add “encoding: utf8” to the database.yml config. So I did. Right
after that the app stopped working. Now I only get the http error 500
page.
How can I get it back to working as before?
Enviromment:
Gentoo linux
mysql 5.0.22
rails 1.1.4
This is a snippet from the log file:
uninitialized constant Mysql
/usr/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:123:in
const_missing' /usr/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:133:in
const_missing’
/usr/lib/ruby/gems/1.8/gems/activerecord-1.14.3/lib/active_record/connection_adapters/mysql_adapter.rb:34:in
mysql_connection' /usr/lib/ruby/gems/1.8/gems/activerecord-1.14.3/lib/active_record/connection_adapters/abstract/connection_specification.rb:251:in
connection_without_query_cache=’
/usr/lib/ruby/gems/1.8/gems/activerecord-1.14.3/lib/active_record/query_cache.rb:54:in
connection=' /usr/lib/ruby/gems/1.8/gems/activerecord-1.14.3/lib/active_record/connection_adapters/abstract/connection_specification.rb:220:in
retrieve_connection’
/usr/lib/ruby/gems/1.8/gems/activerecord-1.14.3/lib/active_record/connection_adapters/abstract/connection_specification.rb:78:in
connection' /usr/lib/ruby/gems/1.8/gems/activerecord-1.14.3/lib/active_record/base.rb:764:in
sanitize’
/usr/lib/ruby/gems/1.8/gems/activerecord-1.14.3/lib/active_record/base.rb:950:in
find_one' /usr/lib/ruby/gems/1.8/gems/activerecord-1.14.3/lib/active_record/base.rb:941:in
find_from_ids’
/usr/lib/ruby/gems/1.8/gems/activerecord-1.14.3/lib/active_record/base.rb:382:in
`find’
However, this error seems to have occured long before I did the above
mentioned change to database.yml, when everything still worked, except
for the encoding corruption.
Best regards,
Daniel