Ruby, Rails and MySQL 5.5 Oh my!
I've seen many postings regarding issues with running 64bit Ruby, Rails and MySQL 5.5 in Leopard/Snow Leopard, especially regarding the missing const error "MysqlCompat::MysqlRes" and the mysql.bundle library issues. After investing about an hour, I had an upgraded MySQL 5.5 and MySQL gem 2.8.1 installation, and I did it like this ...
- Download and install MySQL 5.5 (I untar it in /usr/local and create a "msyql" symlink to ease upgrades) - configure your /etc/my.cnf as necessary.
- Fire up your new MySQL installation to make sure it works (/usr/local/mysql/bin/mysqld_safe ...) will work for now, or you can go ahead and enable startup via launchctl.
- Uninstall all mysql gems (root and individual user level gems).
- Install the new gem for root:
- sudo su - (if you're not already root)
- env ARCHFLAGS="-arch x86_64" gem install --no-rdoc --no-ri mysql -- --with-mysql-dir=/usr/local/mysql --with-mysql-config=/usr/local/mysql/bin/mysql_config
- install_name_tool -change libmysqlclient.16.dylib /usr/local/mysql/lib/libmysqlclient.16.dylib /Library/Ruby/Gems/1.8/gems/mysql-2.8.1/lib/mysql_api.bundle
- vi (or mate) /Library/Ruby/Gems/1.8/gems/mysql-2.8.1/test/test_mysql.rb - add a require "rubygems"
- ruby test_mysql.rb - see if everything passes:
(115 tests, 391 assertions, 0 failures, 0 errors)
- For user installed gem, do the same as you did for the root user, except update your paths accordingly.
--Noel (ngeren)
0 Comments:
Post a Comment
<< Home