Rails error (mysql-related)

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

hmm, forgot to mention that I tried to delete “encoding: utf8” from the
database.yml file and restarted both mysql and lighttpd. It did not
help.
Please help me!

Daniel

Update:

Did this Mysql error running ruby script/generate - Rails - Ruby-Forum but then I got
another error saying some socket wasn’t found (something like
mysql.sock) so I changed it back again.

I also did try to update the mysql gem by running: gem update mysql in
the terminal. I picked the 2.7 ruby version.

Also tried to create a new rails app but it has the same problem. This
makes me believe that the error is in some of the central rails files…

Do you have ANY input for me? I’m qlueless…

Daniel wrote:

Update:

Did this Mysql error running ruby script/generate - Rails - Ruby-Forum but then I got
another error saying some socket wasn’t found (something like
mysql.sock) so I changed it back again.

I also did try to update the mysql gem by running: gem update mysql in
the terminal. I picked the 2.7 ruby version.

Also tried to create a new rails app but it has the same problem. This
makes me believe that the error is in some of the central rails files…

Do you have ANY input for me? I’m qlueless…

Update2:

Solved it by rebooting the production server. Happy camper again!

Best regards,

Daniel