views:

648

answers:

2

I have a web-app that was done in Rails 1.2.3 and I have just migrated it to rails 2.2.2 and upon deploy the app broke. It turns out I needed to install the MySQL gem since rails 2.2.2 needs this.

So, I did install it but I had to install with "sudo gem install mysql -- -with-mysql-config" (as per http://brantinteractive.com/2007/02/16/getting-the-mysql-gem-installed-on-ubuntu/) and that seemed to do the trick. I am on Ubuntu 6.06.2 LTS Dapper.

The app wouldn't boot up in production still. So I booted with script/console production and this is what came back:

Loading production environment (Rails 2.2.2)
Character set 'utf8' is not a compiled character set and is not specified in the '/usr/share/mysql/charsets/Index' file
/usr/local/lib/ruby/gems/1.8/gems/activerecord-2.2.2/lib/active_record/connection_adapters/mysql_adapter.rb:548:in `real_connect':Mysql::Error: Can't initialize character set utf8 (path: /usr/share/mysql/charsets/)
>>

I did some searching around on this error and somebody said that the mysql client I am using (the MySQL gem!) isn't connecting using UTF8. I don't know how to install this gem any other way so that it installs correctly. Any ideas?

A: 

I would suggest to check the compatible version with MySql version installed, like mysql-2.7.3.gem, would go well with mysql 5.1 or higher, but would have problems with 5.0. secondly check if your mysql is installed properly like to mysql prompt try creating database. then if both of the issues are resolved, just verify the socket path of your mysql installation and add that to your database.yml file.

socket /var/tmp/mysql/mysql.sock.
T.Raghavendra
A: 

Confirmed. Installing libmysqlclient15-dev overtop of libmysqlclient12-dev did the trick.

Jef