views:

518

answers:

2

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.

Thanks!

+2  A: 

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.

Ryan Bigg
Thanks! I will give this a shot this evening and I will let you know how it goes.
Jason Whitehorn
Nope... still having the same problems after following those steps :-(
Jason Whitehorn
I ended up doing a clean install of Snow Leopard and then followed those instructions, and that did the trick. I wish I didn't have to go that route, but at least I can get back to developing :-)
Jason Whitehorn
I too did a clean re-install and covered all I installed here: http://frozenplague.net/2009/08/snow-leopard-rubyrails-developer-setup/
Ryan Bigg
I was also having trouble with gem compilation until I tried Stefan Haubold's suggestion (http://weblog.rubyonrails.org/2009/8/30/upgrading-to-snow-leopard, comment #15) and added /usr/local/mysql/bin to my path. It worked fine after that. I used the binary MySQL install.
Marcel Levy
A: 

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

http://weblog.rubyonrails.org/2009/8/30/upgrading-to-snow-leopard

bartligthart