MySQL Ruby Gem on OS X Snow Leopard


I've been fighting with getting the MySQL Ruby Gem up and running on Snow Leopard for the past couple of days.

I have tried all different sorts of things to get this working, and currently have MySQL 5.1.37 x64 installed. After fighting to even get the Gem installed I believe that I finally got it installed, but whenever I attempt to access my Rails site I immediately receive the following error:

/!\ FAILSAFE /!\  Tue Sep 01 21:47:23 -0500 2009
Status: 500 Internal Server Error
    Client does not support authentication protocol requested by server; consider upgrading MySQL client
    /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/mysql.rb:453:in `read'
    /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/mysql.rb:130:in `real_connect'

The remote server I am attempting to connect to is running MySQL version 5.0.70, and can be connected to by other clients (including Sequel Pro running from my machine).

Here are some of the versions of software currently installed on my machine:

  • MySQL 5.1.37 OS X 10.5 x86-64
  • Ruby 1.8.7 (2008-08-11 patchlevel 72) [universal-darwin10.0]
  • Gem version 1.3.5

I have read other accounts of people getting this working on Snow Leopard, so surely I've missed a step. Any advise would be greatly appreciated.



on the official weblog of ruby on rails they told something about leopard

There's a post about this that basically says:

  • Compile it from source using: CC=gcc CFLAGS="-arch x86_64 -O3 -fno-omit-frame-pointer" CXX=gcc CXXFLAGS="-arch x86_64 -O3 -fno-omit-frame-pointer -felide-constructors -fno-exceptions -fno-rtti" ./configure --prefix=/usr/local/mysql --with-extra-charsets=complex --enable-thread-safe-client --enable-local-infile --enable-shared --with-plugins=innobase && make && sudo make install
  • Install the mysql gem with: sudo env ARCHFLAGS="-arch x86\_64" gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config

I did this and it works for me.

By : Ryan Bigg

This video can help you solving your question :)
By: admin