Article ID: 6237, created on Apr 10, 2009, last review on Jun 17, 2016

  • Applies to:
  • Plesk for Linux/Unix

For other versions of Parallels Plesk please see the following articles: 10.4, 11.0, 11.5 and 12.


How to create a simple Ruby on Rails (ROR) application on a domain?


  1. Enable ROR support in Parallels Plesk Panel. You may do this via Autoinstaller in the Control Panel. Log in to Parallels Plesk Panel as admin and navigate to this page: Home -> Updates -> Parallels Plesk Panel 9. Enable the Ruby on Rails support option and click the Install button to start installation of ROR support.

  2. Create a test domain, DOMAIN.TLD.

  3. In the hosting configuration, enable SSH access, CGI, and FastCGI (Domains -> DOMAIN.TLD -> Web Hosting Settings):

    Shell access to server with FTP user's credentials [/bin/shell]
    CGI support [x]
    FastCGI support (required for Ruby on Rails) [x]

    (where /bin/shell is the shell available for the Plesk server). The list of system shells is stored in the /etc/shells file and can be obtained by the system administrator:

    ~# cat /etc/shells

    4. Log in to the domain via SSH with the login and password of the domain FTP user:

    -sh-3.2$ ls -l
     total 48
     drwxr-x--- 5 FTP.USER psaserv 4096 Apr  3 11:27 anon_ftp
     drwxr-xr-x 2 root     psaserv 4096 Apr  3 11:27 bin
     drwxr-x--- 3 FTP.USER psaserv 4096 Apr  3 11:27 cgi-bin
     drwxr-x--- 2 root     psaserv 4096 Apr 10 09:17 conf
     drwxr-xr-x 2 root     psaserv 4096 Apr  3 11:27 error_docs
     drwxr-x--- 7 FTP.USER psaserv 4096 Apr  3 11:27 httpdocs
     drwxr-x--- 7 FTP.USER psaserv 4096 Apr  3 11:27 httpsdocs
     drwxr-x--- 2 root     psaserv 4096 Apr  3 11:27 pd
     drwx------ 2 FTP.USER root    4096 Apr  3 11:27 private
     dr-xr-x--- 7 root     psaserv 4096 Apr  3 11:27 statistics
     drwxr-xr-x 2 root     psaserv 4096 Apr  3 11:27 subdomains
     drwxr-xr-x 2 root     psaserv 4096 Apr  3 11:27 web_users
  4. Change to the httpdocs directory:

    -sh-3.2$ cd httpdocs
  5. Create a test application, ruby_test_application, in the current directory:

    -sh-3.2$ rails -D ruby_test_application

NOTE: "-D" is necessary to add dispatchers (dispatch.fcgi) into the public folder. Dispatchers are necessary for the Ruby on Rails application to work in Plesk with FastCGI.

  1. Change to the ruby_test_application directory:

    -sh-3.2$ cd ruby_test_application
  2. Execute the following command to create a new controller with the name Hello:

    -sh-3.2$ ruby script/generate controller Hello index
           exists  app/controllers/
           exists  app/helpers/
           create  app/views/hello
           exists  test/functional/
           create  app/controllers/hello_controller.rb
           create  test/functional/hello_controller_test.rb
           create  app/helpers/hello_helper.rb
           create  app/views/hello/index.rhtml

You may use another name for the test controller. (Replace "Hello" as you like.)

  1. Open the ruby\_test\_application/app/controllers/hello\_controller.rb file in a file editor and change its content. Currently, you are in the ruby\_test\_application directory, so you should use the following command to open the file:

    -sh-3.2$ pwd
     -sh-3.2$ vim app/controllers/hello_controller.rb

Find the following content:

     class HelloController ApplicationController

       def index

and replace it with the following:

    class HelloController ApplicationController
     def index
                     @message = "Hello World"
  1. Open the ruby\_test\_application/app/views/hello/index.html.erb file in the file editor:

    `-sh-3.2$ pwd
     -sh-3.2$ vim app/views/hello/index.html.erb`

    And change content from

     <p>Find me in app/views/hello/index.rhtml</p>


     <h1><%= @message %></h1>
  2. Put the .htaccess file with the following content into the application’s root (/var/www/vhosts/DOMAIN.TLD/httpdocs/ruby_test_application):

    RewriteEngine On
     RewriteRule ^$ public/index.html [L]
     RewriteCond %{REQUEST_URI} !^/ruby_test_application/public
     RewriteRule ^(.*)$ public/\$1 [L]
     RewriteCond %{REQUEST_FILENAME} !-f
     RewriteRule ^(.*)$ public/dispatch.fcgi/$1 [QSA,L]
  3. Open the config/routes.rb file in the editor and change lines starting with "map.connect" by adding "/ruby\_test\_application/" in front of string values, e.g.:

    map.connect '/ruby_test_application/:controller/:action/:id'
    map.connect '/ruby_test_application/:controller/:action/:id.:format'
  4. Open the application in a web browser to see if it works:


    There should be a record named Hello World.

Additional information

Documentation about installation of Ruby web applications on a Plesk domain is available in Parallels Plesk Panel 9 Administrator's Guide.

Search Words

Ruby on Rails (ROR) application

a914db3fdc7a53ddcfd1b2db8f5a1b9c 29d1e90fd304f01e6420fbe60f66f838 56797cefb1efc9130f7c48a7d1db0f0c

Email subscription for changes to this article
Save as PDF