Installing MySQL Ruby Gem in Snow Leopard Server
Snow Leopard Server doesn't come with MySQL client and library files.
In order to get them we need to download a package, for Snow Leopard Server 10.6.2:
http://www.opensource.apple.com/other/MySQL-49.binaries.tar.gz (71.2MB)
The main entry page should be http://www.opensource.apple.com/release/mac-os-x-1062/ but I cannot find the package there, getting the url was guess work from reading an Apple support page: http://support.apple.com/kb/TA25017
What we are doing is to uncompress a archive directly in our root.
Once you get the file you should decompress it unless your browser already did for you.
Since Safari did it for me I'm having MySQL-49.binaries.tar in my Downloads folder.
Open up a terminal.
cd Downloads sudo tar -xvf MySQL-49.binaries.tar -C / # use -zxvf if you still have the .tar.gz file
We should have the required libraries in order to install the MySQL Ruby Gem.
You may have already read the previous articles about MySQL and Ruby, however the procedure is different:
sudo env ARCHFLAGS="-arch x86_64" gem install mysql
This should give you a working installation of MySQL Gem.
Related posts:
- Install MySQL and MySQL Ruby gem on Snow Leopard, 64 bit
- CentOS “gem install mysql” problems, solution
- Snow Leopard server FAQs, part 1
- Hosting Git repositories through WebDAV on Snow Leopard Server
- Snow Leopard server wallpaper
Enjoy this article?
Additional comments powered by BackType
January 21st, 2010 - 14:09
Thanks, i was looking for a solution since yesterday and find yours…. Great….
January 22nd, 2010 - 13:48
Just one question, do you know why Apple don’t distribute officially this binaries. It’ll be more easy for every body ?
January 22nd, 2010 - 13:49
I don’t know. My guess is that they don’t have up to date documentation on the matter.
January 22nd, 2010 - 15:11
You’re right …. That’s really strange…..
February 5th, 2010 - 19:27
Did not work on my new Mac Mini Server. I get the following:
server:~ hostadmin$ sudo env ARCHFLAGS=”-arch x86_64″ gem install mysql
Password:
Building native extensions. This could take a while…
ERROR: Error installing mysql:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
mkmf.rb can’t find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ruby.h
Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/mysql-2.8.1 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/mysql-2.8.1/ext/mysql_api/gem_make.out
Any ideas on what I’m doing wrong?
February 5th, 2010 - 19:30
did you installed Xcode?
February 6th, 2010 - 06:41
you are my hero…. Xcode did the trick. I’m new to the Mac… what did Xcode install do that made mysql gems install work?
February 25th, 2010 - 18:30
Xcode installed the header files for various programming languages. If you don’t install the dev tools on a regular desktop version of OS X, then you’ll get the same thing when trying to install any gem that requires some C libraries to be built.
July 20th, 2010 - 20:24
Diamonds and Rubys are my favorite gemstones, i like the color red and the sparkle of diamond.*.`
July 21st, 2010 - 21:13
For Snow Leopard 10.6.4 Server, the version of MySQL changed to 5.0.88, and the resultant new binary tarball is: http://www.opensource.apple.com/other/MySQL-53.binaries.tar.gz . Everything else is the same