Steps you can Perform to Deploy a Demo Rail Application

February 6th, 2010

1. Login to your SSH using your own account.
2. Once logged in make sure you are in your /home/username folder using the “pwd” command.

It should show the output like this:

cpaneluser@server [~]# pwd

3. Then run the following commands to generate a demo rail app and its controller.

cpaneluser@server [~]# rails /home/cpaneluser/demoapp
cpaneluser@server [~]# cd demoapp
cpaneluser@server [~]# ruby script/generate controller test

4. Now create a symlink in public_html so that the app is viewable via the web.

cpaneluser@server [~]# cd ../public_html
cpaneluser@server [~]# ln –s ../demoapp/public rails

5. Before you test the Rails page, there is one more modification you need to make.

cpaneluser@server [~]# cd ../demoapp/public
cpaneluser@server [~]# pico .htaccess

Locate the line where it has the code like below:

RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]

Change that code to:

RewriteRule ^(.*)$ dispatch.cgi [QSA,L]

You can then visit and you should see a “Welcome Aboard” page which confirms successful working of your rail app. You can deploy any other standard Rail applications as well. Most of them should work well with the preinstalled Gems we have.

Leave A Comment