Here’s a script to automatically download, build, and install the OS X versions of the following software:
- Readline (5.2)
- Ruby (1.8.6)
- Rubygems (0.9.4)
- Subversion (1.4.5)
- MySQL (5.0.45)
- Rails (latest version)
- Mongrel (latest version)
- Capistrano (latest version)
The steps it takes mirror those explained in Hivelogic’s great post Building Ruby, Rails, Subversion, Mongrel, and MySQL on Mac OS X. If you’re of the variety that can’t easily understand the instructions in HiveLogic’s post (for some reason your humorless software-engineer–partner insists you run the Rails app on your local machine for development), or if you’re the variety that has to do this installation samba prance dance on a frequent basis, then this might come in handy for you.
The reason we wrote this script isn’t to make it easy for beginners to install everything they need (although that certainly also happens to be a good use for it), but because we found ourselves having to install all this stuff on lots of new MacBook Pros, and after the second time of doing it manually, it got tedious and a waste of time. If you already know what you’re doing, this script is meant to save you some time.
- Download the script:
- Open Terminal.
-
Type:
bash /directory/where/i/downloaded/the/file/install.sh
Sudo will prompt you for your administrator password after you run the script, and then blast off with a flurry of downloading and compiling. You’ll have to do some clickety-clicking to help MySQL install itself. Then sit back — you just saved 15 minutes (or 4 hours).
- Before you run the script, you’ll need to have Xcode installed. Unfortunately, I can’t make the script download and install it automatically, since you need to login to with an ADC account to download it. It’s an almost 1 GB download, so plan accordingly. But real developers have Xcode installed, so it’s OK.
- While installing the gems, you’ll probably be prompted to choose which version to install for a number of the gems. Choose the option for the highest Ruby version listed (i.e., not the ‘mswin32’ version).
- If the script complains when installing the MySQL gem, see our post about installing the Ruby mysql-2.7 gem on OS X 10.4.
- Since you can only really run this script once, I have only tested it a few times, on a Powermac and a few MacBook Pros running OS X 10.4.10 and 10.5. If you run into any problems, send us a bug report so I can improve the script.
- There’s no easy way to make the script automatically download the latest versions of the software involved (except for the gems), so I’ll try to keep the script up-to-date as new versions of the software it installs are released. (If I fall behind, just email me and I’ll post an update, and maybe send you a Sakuzaku t-shirt or pin badge for your trouble.)













