Rails, MySQL and Snow Leopard

Rails, MySQL and Snow Leopard

I just went through the same pain... here's what worked for me:

  1. Download / install the 64-bit MySQL 5.1.37 from mysql.com
  2. run the following commands:


sudo gem update --system

sudo env ARCHFLAGS="-arch x86_64" gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config

I also uninstalled all mysql gems that were floating around from my 10.5 days, that may do it if the above doesn't work for you :)

Ruby on Rails, MySQL and Snow Leopard

Well lets start off with the fact your building the incorrect gem.

From your error report it appears your using Rails 3, and this doesn't use the "mysql" gem at all. It uses the mysql2 gem which offers a number of performance features.

You can read more about the mysql2 gem at http://github.com/brianmario/mysql2

I think you will be fine once you install the correct gem. =)

Ruby On Rails in MAMP mySQL Snow Leopard

I can suggest this tutorial for you;
Using Ruby MySQL Gem with MAMP 1.8.x on Snow Leopard

Snow Leopard install Ruby on Rails (with MySQL)

You can certainly install the 64-bit packages. They will be able to access the memory space and every advantage of running with 64bits. The only thing that won't boot in 64bit is the Kernel, but it's not something to be worrying about for the moment.

Check out the Hivelogic's guide for installing MySQL, Rails and Ruby on Snow Leopard:

MySQL
Git
Ruby, Rails

MySQL Gem failure: MysqlCompat::MysqlRes on Snow Leopard

You can easy fix your problem.

If you don't use rvm:

sudo 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.bundleruby

If you use rvm:

install_name_tool -change libmysqlclient.16.dylib usr/local/mysql/lib/libmysqlclient.16.dylib [YOUR_GEMSET_PATH]/gems/mysql-2.8.1/lib/mysql_api.bundle

Mysql gem for Snow Leopard Install

ALl good,

installed 64 bit mysql, and worked ok.

Install mysql2 gem on Snow Leopard for Rails 3 with rvm

I actually had the wrong adaptor set on my database.yml

So the fix is


development:
adapter: mysql2
database: development_database
username: root
password:

Instead of


adapter: mysql

Doh!



Related Topics



Leave a reply



Submit