moved a rails app of mine onto a new server and had to install a few gem dependencies. However, after installing the mysql gem I get the error, uninitialized constant Mysql
sudo env ARCHFLAGS="-arch x86_64" gem install mysql
Dmg package from the mysql site an ddone!
sudo apt-get install libmysqlclient15-dev
sudo gem install mysql -v 2.7 -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
Worked perfectly for me :)
If you have mysql 5.5 follow this: http://geryit.com/blog/2011/01/installing-mysql-with-rails-on-mac-os-x-snow-leopard/
FTR: If I didn't need some stupid rep to upvote I would have upvoted the identitcal answer, consider this my upvote.
With mysql gem (2.8.1) I was getting
uninitialized constant MysqlCompat::MysqlRes
Using -v 2.7 make it work perfectly and for those who used Homebrew to install mysql
sudo gem install mysql -v 2.7 -- --with-mysql-config=/usr/local/Cellar/mysql/5.1.48/bin/mysql_config
Note that you can change mysql version if needed.
Downgrade (from 5.9) to mysql 5.1 helped on 10.6 ... running both mysql and mysql2 gems.