Installing MySQL 5 and mysql-ruby on Mac OS X 10.5
I hate installing open source software. It’s ridiculous. Here’s the quick and dirty on how to install MySQL 5 and mysql-ruby (not ruby-mysql) on Mac OS X 10.5 / Leopard.
Grab MySQL 5 off of mysql.com and install the package. Unfortunately (as of 5.0.45) the startup item and preference panel don’t work with 10.5 at all and very well respectively. To create a working startup item, see “Problem 1″ in Sam Bauer’s post.
That’ll get MySQL installed and fired up (and will automatically fire it up every time you restart). The preference panel will accurately tell you whether the server is running, but the button in it still won’t start and stop the server. Bummer.
As for mysql-ruby, I’ve had nothing but trouble installing this sucker. On Mac OS X 10.4 I couldn’t get the RubyGems installer to work (I don’t remember what the problem was) but I figured out how to build it “by hand” (my dad documented a similar process here).
On 10.5 this no longer works, and nothing I tried helped. (Yay for errors.) Instead, I went back to trying RubyGems. This time it’s a little bit easier, but still borked and needs some loving. Jerrett Taylor put together a brief little post on how to make it work, but it was a teeensy bit vague and confused me for some reason, so here’s what you have to do…
First, build/install mysql-ruby using RubyGems:
If you’re on Intel, your architecture or “arch” is going to be “i386″, and on any PPC it’s going to be “ppc”. So replace the arch value below with the appropriate one for your architecture.
ARCHFLAGS="-arch i386" gem install mysql — –with-mysql-config
Don’t be fooled by line two. That actually is all supposed to be on the same line. (Jerrett’s post confuzzled me a little bit since I had previously been looking a bunch of posts with mysteriously missing line breaks.)
After you run that, run the command below to fix a linking error in the mysql.bundle created by mysql-ruby. For some reason it looks for a library in “/usr/local/mysql/lib/mysql/…” which doesn’t exist, so this command changes that path to the correct one.
The last argument to the command is the path to the bundle you’re fixing. You’ll may need to change the last path on that command, but for me it was correct. (It should always be the same if you used RubyGems as above.)
After that, it should all be working now.
Good luck.







Comments(1)