Icn_rssSubscribe to RSS Feed

Articles & Support

Back to Discussions

Sandboxing Rails

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

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

Posted on Jun 28, 2008 by Robert Bousquet

Post Your Thoughts

NOTE: We review each comment added to our site. We do not appreciate unsolicited advertising, inappropriate or offensive comments published to The Leader Board. Challenging questions or opinions are okay. Please be respectful. Thank you.