Mac OSX has become extremely popular for Ruby on Rails development. Part of this is the inclusion of Ruby as part of the operating system on Mac OSX Leopard. Here is a quick tutorial on how to get Ruby on Rails and MySQL set up on your Mac OSX Leopard machine. In order to complete this tutorial, you need the Xcode tools installed. You can get them off of the applications disk that came with your mac or from http://developer.apple.com/TOOLS/xcode/.
Once you have Xcode Tools installed, open your terminal (in Applications > Utilities) and let’s get started!
1. Update RubyGems.
sudo gem update --system
2. Install Ruby on Rails.
sudo gem install rails
3. Download the MySQL (x86) package from this page.
4. When the .dmg file loads, install both packages (.pkg files) and the MySQL.prefPane.
5. Once MySQL is installed, install the mysql gem. (Thanks wonko.com for the tip.)
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
That’s it! You’re ready to go! Now all you have to do is create a rails application and you’re ready to go.