The Syncing Apple An Exploration of Technology and Devices

9Jan/090

Mysql Gem for OSX Lepard Ruby

ruby_img.jpgWant to build the mysql gem for the system's Ruby and use the mysql binary you just installed from mysql.org?

Easy, has wonko.com has the answer and it worked perfectly! I love Google.

airbot:~ [504]$ sudo env ARCHFLAGS="-arch i386" gem install mysql -- \
>   --with-mysql-dir=/usr/local/mysql --with-mysql-lib=/usr/local/mysql/lib \
>   --with-mysql-include=/usr/local/mysql/include
Password:
Bulk updating Gem source index for: http://gems.rubyforge.org
Building native extensions.  This could take a while...
Successfully installed mysql-2.7
1 gem installed

And your off.....

Update: don't forget to add the gems require at the top of your ruby scripts:

require 'rubygems'

This will get rid of the

in `require': no such file to load -- mysql (LoadError)

errors. On my linux machine, mysql was not installed as a gem so I didn't have the require in my scripts.

Filed under: Coding, Tech Leave a comment
Comments (0) Trackbacks (0)

No comments yet.


Leave a comment

You must be logged in to post a comment.

Trackbacks are disabled.