Found Elsewhere…

Newleaders

Sandboxing Rails

Published by Robert Bousquet on Fri May 30 16:13:00 UTC 2008

James Duncan Davidson wrote up a great recipe for installing Rails that I have been pointing people to for a couple years. For some reason it’s now missing from his site so here’s my version of it from memory:

1. Install Apple Developer Tools, available on your OSX DVD or as a free download from http://developer.apple.com

2. Install the Macports package manager for OSX. It will manage the installation of all the libraries we need.

3. Hide the /opt directory from displaying in the OSX Finder gui

$ sudo echo opt >> /.hidden

4. Follow this series of commands to get them all installed from the Terminal.

$ sudo port install mysql5 +server
$ sudo port install subversion +tools
$ sudo port install ruby
$ sudo port install rb-rubygems
$ sudo port install rb-mysql
$ sudo port install rb-termios
$ sudo gem install rails

Add the following to your ~/.profile file:

export PATH=/opt/local/bin:$PATH

5. Optional installs I recommend

$ sudo port install rb-rmagick
$ sudo port install git-core +svn
$ sudo gem install deprec
$ sudo gem install mongrel

6. Bind the mysql5 server to 127.0.0.1 if this is your laptop/development machine. Create a /etc/my.cnf file containing the following:

[mysqld]
#IP address to bind to.
bind-address=127.0.0.1

7. Configure mysql5 to start automatically at boot by running the following two commands:

$ sudo launchctl load -w /Library/LaunchDaemons/org.macports.mysql5.plist
$ sudo -u mysql mysql_install_db5