Rails, MySQL and Snow Leopard
I just went through the same pain... here's what worked for me:
- Download / install the 64-bit MySQL 5.1.37 from mysql.com
- 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
Stored Procedure That Automatically Delete Rows Older Than 7 Days in MySQL
Remove Duplicate Rows in MySQL
How to Return Rows That Have the Same Column Values in MySQL
How to Update If Exists, Insert If Not (Aka "Upsert" or "Merge") in MySQL
Is Select or Insert in a Function Prone to Race Conditions
Why Isn't SQL Ansi-92 Standard Better Adopted Over Ansi-89
Is a View Faster Than a Simple Query
Calculate Age in MySQL (Innodb)
MySQL - Error 1045 - Access Denied
SQL Query Return Data from Multiple Tables
SQL Update from One Table to Another Based on a Id Match
How to Query Between Two Dates Using MySQL
Return Row With the Max Value of One Column Per Group