How do I set up Ruby on Rails?

Ruby on Rails is a database-driven website framework designed to be easy for programmers to maintain.

To set it up, you will need a hosting package with:-

– SSH access
– 3 MySQL databases (for a standard test, production, live configuration)

The ideal way to install Rails is using our “” script, which will correctly configure Rails for MySQL and our web servers.

Once you have logged in to SSH, to install Rails at you’d do:

[ ~]$ /usr/local/bin/ somedirectory
[ ~]$ ln -sf `pwd`/somedirectory/public public_html/somedirectory
[ ~]$

You now need to configure Rails to access your MySQL databases. For this you will need to set up 3 databases (by default) using the Web Hosting Plus Control Panel. Note down the names of these, for example you could choose web224-rubyprod, web224-rubytest, web224-rubylive.

Edit the file somedirectory/config/database.yml (NOTE: not database.yaml, as the script will erroneously instruct) and update the database, username and password settings appropriately.

You can now visit to see the welcome page and confirm the installation has succeeded.

If you want to go on to create a sample page, try:

[ ~]$ cd somedirectory
[ somedirectory]$ script/generate controller welcome
exists app/controllers/
exists app/helpers/
create app/views/welcome
exists test/functional/
create app/controllers/welcome_controller.rb
create test/functional/welcome_controller_test.rb
create app/helpers/welcome_helper.rb
[ somedirectory]$ echo ‘Hello, World! 1 + 2 = <%= 1+2 %>‘ > app/views/welcome/index.rhtml
[ somedirectory]$

You would then be able to view this at . For more information, please see the Ruby on Rails web site.

If you want to have your entire site run through Rails (and you’re certain), then rename your public_html directory, and follow the same procedure above except that instead of “ln -sf `pwd`/somedirectory/public public_html/somedirectory” you should write “ln -sf `pwd`/somedirectory/public public_html”.