Surpass Hosting

How to Deploy Ruby Applications

Ruby apps the easy way

Deploying a Ruby on Rails application on the Developer Plan only takes a few easy steps thanks to Phusion Passenger. (These instructions are available and up for discussion in our Community here.)

Step 1: Upload your application

Upload your application somewhere above public_html.

Step 2: Run migrations

SSH to the server, cd to your application's directory, and run the following command:

rake db:migrate RAILS_ENV="production"


This will run the migration on the database specified under "production:" in config/database.yml.

Note: You must specify RAILS_ENV="production" when running the migration. Phusion Passenger forces the application to run in production mode.

Step 3: Set up your webroot

If your application uses the default Rails directory structure, your public files (css, js, etc) will be located in "public". To get public working as your webroot, you can delete your public_html directory and create a symlink to your application's public directory in its place:

ln -s /path/to/application/public public_html


Note: If your application is going to be on a subdomain, you can specify the webroot when creating the subdomain in cPanel.

Step 4: Restart the application

Since Phusion Passenger runs your application in production mode, you must restart the application everytime a change has been made. To restart your application, create or modify the restart.txt file in your application's tmp directory:

touch /path/to/application/tmp/restart.txt

© Copyright 2002-2011 Surpass Hosting, LLC. All rights reserved.