No description, website, or topics provided.
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


Setting up Ruby on Rails and Passenger on a Mac

A set of scripts and instructions on setting up multi-site development for Ruby on Rails projects using Passenger on your mac. Instructions are tailored for my coworkers.

Prerequisites & Preface

In order to do some of these tasks you will need a compiler. On Mac OS X the best way to do this is to install the Apple Developer Tools which can be found on the Mac OS X install disk or online at the Apple Developer Site.

After installing, make sure your path is setup correctly:

echo $PATH
# you should see /usr/local/bin:/usr/local/sbin

If you don't see those paths, or you've never changed your path then do this:

nano ~/.profile

And on the first line of that file:

export PATH="/usr/local/bin:/usr/local/sbin:$PATH"

Save (ctrl-o) then exit (ctrl+x).

First, let's setup passenger

Passenger is an Apache module to enable Apache to server Ruby on Rails and other Rack based applications. To install:

sudo gem install passenger

Now run the passenger apache setup utility:

sudo passenger-install-apache2-module

Follow the prompts, at the end of the installation process you will be instructed to update your apache configuration file with something along the lines of:

LoadModule /path/to/something

Copy whatever line is displayed and add it to your apache configuration file located at /etc/apache2/httpd.conf. This command will open a command line editor which will allow you to paste in the new line.

sudo nano /etc/apache2/httpd.conf

You may also be able to use Coda, try command+O and navigating to /etc/apache2/httpd.conf or even easier, from the terminal:


Then drag the httpd.conf file onto the Coda icon in your dock. Restart apache and test:

sudo apachectl restart

Then open http://localhost and make sure the default apache site shows up. You should now have passenger installed!

Next, install the vhost scripts

Download these files and unzip them.

Open the terminal and cd root of the folder for this download

cd /path/to/sitesetup

Then run the install script:

sudo ./

Make a rails project

Now you should be able to create and enable a rails project.

rails project_name
cd project_name
sudo sitesetup project_name/public -H

You can use whatever you want for and from your computer you can now use that URL to access your rails site. I like to use the same host as the production site except replacing .com with .dev.