You have got to congratulate the crazy agonizing, MySQL install-fests for my Ruby On Rails environment for the revival of this geek blog. Hooray.
First I’d like to thank stackoverflow.com for pointing me to the right direction when I’m getting this type of error from the gem install of mysql:
Normal gem install of mysql gives me all these No Definition error for <sql tag name>. After hours of installing 100+MB packages and source codes and I am just about to hurl myself to the nearest wall. Someone saved me.
This tutorial over here made everything work except for their gem install >>
http://weblog.rubyonrails.org/2009/8/30/upgrading-to-snow-leopard
So I made up my own steps for the MySQL part. Here’s the steps that worked for me:
Installing MySQL with Rails 2.3.11 and Ruby 1.8.7 for Snow Leopard
- Remove higher version of MySQL (> v5.1)
- Get MySQL v5.1 64bit for 10.6 Oses :mysql-5.1.56-osx10.6-x86_64.dmg
- Install the following
- mysql-5.1.56-osx10.6-x86_64.pkg
- MySQLStartupItem.pkg
- MySQL.prefPane
- Unmount dmg after use
- Start MySQL server from Preferences
- Install the following
- Install MySQL gem using the following command
sudo env ARCHFLAGS=”-arch x86_64″ gem install –verbose mysql –version 2.7 — –with-mysql-include=/usr/local/mysql/include –with-mysql-lib=/usr/local/mysql/lib
(NOTE: the version is important as font-size: normal2.8.1 gem most probably is for rails 3 usage. Not specifying the version will let gem install 2.8.1 and leads to all those nasty No Definition things.2.7 version worked for me. - Set Environment for MySql
export PATH=”/usr/local/bin:/usr/local/mysql/bin:$PATH”
(NOTE: count how much time it takes to type /usr/local/bin/sql, for me? 4 seconds. How much time it is to copy paste the export PATH into the terminal screen? Less than 1 second. How much time it takes to type mysql? Less than 1 second. Enjoy.
Hey, thanks, this was a life-saver!
Posted by Michael | June 2, 2011, 4:09 amHi Michael, I glad this works for you too
Posted by wastefulspace | June 2, 2011, 5:55 pm