Ruby on Rails
HowtoInstallOnOSXTigerUsingMacPorts (Version #13)

Installing MacPorts

Firstly, install the Apple Developer Tools (Xcode) found on the Mac OS X installation disk or downloaded from the Apple Developer Connection downloads page.

Download and install MacPorts itself. MacPorts can be installed with a .dmg image using a familiar step-by-step installer.

Installing Ruby and RubyGems

Open the Terminal application and type the following command, followed by the return key. It will most likely prompt you to enter your password.

sudo port install ruby rb-rubygems

Installing Rails

Installing Rails using RubyGems is a simple command:

sudo gem install rails

That’s it! Now you’re ready to create new Rails applications with the rails command.

Optional Installs

MySQL

MySQL provides a more powerful database than the default SQLite. Install MySQL and its Ruby bindings with:

sudo port install mysql5 rb-mysql

You’ll want to follow the post installation instructions after installing MySQL, most importantly the following command:

sudo /opt/local/bin/mysql_install_db5 --user=mysql

PostgreSQL

Some users perfer the PostgreSQL dabase over others. Use this command to install PostgreSQL:

sudo port install postgresql81 postgresql81-server rb-postgres

Mongrel

Mongrel is a web server suitable for production environments. Once mongrel is installed, using script/server will automatically detect Mongrel and use it instead of the default WEBrick.

sudo gem install mongrel

Lighttpd

Lighttpd is an extremely fast web server, suitable for high-traffic sites. Keep in mind that Mongrel is considerably easier to configure if you are new to Rails.

sudo port install lighttpd

ImageMagick and RMagick

ImageMagick is a powerful image processing library, with RMagick providing a Ruby interface. Install with the following two commands:


sudo port install ImageMagick
sudo gem install rmagick

Git

sudo port install git-core

Subversion

sudo port install subversion

Installing MacPorts

Firstly, install the Apple Developer Tools (Xcode) found on the Mac OS X installation disk or downloaded from the Apple Developer Connection downloads page.

Download and install MacPorts itself. MacPorts can be installed with a .dmg image using a familiar step-by-step installer.

Installing Ruby and RubyGems

Open the Terminal application and type the following command, followed by the return key. It will most likely prompt you to enter your password.

sudo port install ruby rb-rubygems

Installing Rails

Installing Rails using RubyGems is a simple command:

sudo gem install rails

That’s it! Now you’re ready to create new Rails applications with the rails command.

Optional Installs

MySQL

MySQL provides a more powerful database than the default SQLite. Install MySQL and its Ruby bindings with:

sudo port install mysql5 rb-mysql

You’ll want to follow the post installation instructions after installing MySQL, most importantly the following command:

sudo /opt/local/bin/mysql_install_db5 --user=mysql

PostgreSQL

Some users perfer the PostgreSQL dabase over others. Use this command to install PostgreSQL:

sudo port install postgresql81 postgresql81-server rb-postgres

Mongrel

Mongrel is a web server suitable for production environments. Once mongrel is installed, using script/server will automatically detect Mongrel and use it instead of the default WEBrick.

sudo gem install mongrel

Lighttpd

Lighttpd is an extremely fast web server, suitable for high-traffic sites. Keep in mind that Mongrel is considerably easier to configure if you are new to Rails.

sudo port install lighttpd

ImageMagick and RMagick

ImageMagick is a powerful image processing library, with RMagick providing a Ruby interface. Install with the following two commands:


sudo port install ImageMagick
sudo gem install rmagick

Git

sudo port install git-core

Subversion

sudo port install subversion