Wednesday, August 6, 2008

Ruby On Rails on Mac OS X

My laptop already had ruby installed (part of the standard OS install), but I decided to get the latest versions and recompile them. Thankfully this is trivial with MacPorts. To install MacPorts, you'll need to have the developer's toolkit installed (gcc, make, etc) - this on the second CD that comes with the laptop.

Once you have MacPorts installed, make sure it's in your path, put this in your .bash_profile :

# MacPorts
PATH=/opt/local/bin:/opt/local/sbin:$PATH; export PATH
MANPATH=/opt/local/share/man:$MANPATH; export MANPATH

Now install ruby and rubygems:

sudo port install ruby rb-rubygems

Use gem to install rails:

sudo gem install rails

Mongrel is much better than WEBrick, so install it:

sudo gem install mongrel
You'll need a database to start using Rails. I'll probably install a local MySQL for that.

No comments: