How to set up a Ruby on Rails environment Print

  • 2

These directions will help you set up your Rails environment for simpler MVC Ruby development. This is not a beginner tutorial - if you know nothing about the command line, then Ruby on Rails is not for you.

Preconfiguration

  1. You must enable FastCGI for your domain. Login to Plesk, click on "Web Hosting Settings" for the domain you wish to use Rails with and enable FastCGI
  2. You will also need SSH access enabled. The option to enable it is also found within Web Hosting Settings. You may require non chrooted access - if this is the case, then some of the steps below will fail. Please open a support request to obtain non-rooted SSH access.

Setting up your Rails application skeleton

  1. Create your rails application skeleton by logging in via SSH and running
  2. /usr/bin/rails /var/www/vhosts/[your_domain]/httpdocs/[your_app_dir]
  3. Within the newly created skeleton, find the 'public' directory. Open the .htaccess file within (notice the leading `.') and change the following line
  4. RewriteRule ^(.*)$ dispatch.cgi [QSA,L] to RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
  5. Visit [your_domain]/[your_app_dir]/public/ to ensure the installation is complete. You should see a "Welcome Aboard" page that was auto-generated by Rails.
From here you can follow the directions on the Welcome Aboard page to set up your database, generate models and controllers and configure routes.


Was this answer helpful?

← Back