MySQL Gem, Ubuntu and UTF8

I have a web application that was made in Rails 1.2.3 and I just migrated to rails 2.2.2 and broke after deploying the application. It turns out I have needed to install the MySQL gem ever since needed for rails 2.2.2.

So I installed it, but I had to install it 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 will not load during production. So I booted with script / console production and this is what happened:

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 searched for this error a bit and someone said that the mysql client I'm using (MySQL gem!) Doesn't use UTF8. I don't know how to install this gem in any other way so that it installs correctly. Any ideas?

+2


source to share


3 answers


Confirmed. Installing libmysqlclient15-dev above the libmysqlclient12-dev top did the trick.



0


source


I would suggest checking for a compatible version with your MySql version installed, like mysql-2.7.3.gem, with MySQL or 5.1, but will have problems with 5.0. second, check if mysql is installed correctly, as in mysql, try to create a database. then if both problems are resolved, just check the socket path of your mysql installation and add this to your database.yml file.



socket /var/tmp/mysql/mysql.sock.

      

0


source


Follow these two steps to install mysql gem 2.7

sudo apt-get install ruby-dev

sudo gem install mysql -v 2.7

0


source







All Articles