This post has already been read 3575 times!
Want 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:~ $ 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:
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.