Installing Ruby on Rails, mySQL and Rmagick on Leopard

Posted by win
on Wednesday, April 02

I recently had to reinstall Ruby on Rails and Rmagick on Leopard. There is a lot of debate surrounding the best way to go – whether it be by source, by MacPorts, by Fink or by anything else I don’t know about yet.

I’ve gone the Macports route and have yet to regret it. As according to Paul Sturgess:

MacPorts (formerly known as DarwinPorts) is a package manager that will download, compile and install software, while installing any required dependencies, automatically. You can easily upgrade or deactivate packages you download, it just makes managing everything that much easier.

Paul Sturgess’ article provides an excellent step-by-step guide that had me running on a Macported Ruby on Rails installation in no time at all.

Quick points from Paul Sturgess:

Set up your path environment variables:

PATH="/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin"

Install mySQL, Ruby, and maybe Subversion:

sudo port selfupdate
sudo port install mysql5 +server
sudo port install ruby
sudo port install rb-rubygems
sudo port install rb-termios
sudo port install rb-mysql
sudo port install subversion +tools

Add a symbolic link to the mysql5 mysqld.sock:

sudo ln -s /opt/local/var/run/mysql5/mysqld.sock /tmp/mysql.sock

Make sure Mysql5 starts up whenever the machine is rebooted with:

sudo launchctl load -w /Library/LaunchDaemons/org.macports.mysql5.plist

Install Ruby on Rails and others:

sudo gem install -y rake
sudo gem install -y rails
sudo gem install -y capistrano
sudo gem install -y mongrel
sudo gem install -y mongrel_cluster

In addition, Educate. Liberate. provides the simple rules to follow to get Rmagick properly installed once you’re rolling on Rails goodness.

Quick points from Educate.Liberate.:

sudo port install tiff -macosx
sudo port install ImageMagick
sudo gem install rmagick

Comments

Leave a response