Deploying Ruby on Rails using cpanel

IMPORTANT: This information is provided for advanced users only. Support cannot advise users on how to code, or provide debugging.


Using your cPanel interface, you can create and deploy a Ruby on Rails application. It may be useful to reference the Ruby on Rails documentation during this process.

Note: Ruby on Rails may not be available on all accounts, please check with support if you require this service.


Creating a Ruby on Rails Application

After you are sure your website's server has a working version of Ruby that is accessible to you, you can create and deploy a Ruby on Rails environment. Ruby on Rails runs on its own server so the setup requires a little extra work.

   1. Log into cPanel.
   2. Navigate to the Software/Services section of your cPanel interface.
   3. Click the Ruby on Rails icon.
          * This step will open the Ruby on Rails management interface.
   4. Specify your application's name in the App Name field.
          * Remember: To set your application to load when the server is booted, click the Load on Boot? checkbox.
   5. Assign the application path in the Application Path field.
          * Note: If you set an application path in your public_html/ directory, your source code and configuration files can be viewed by anyone on the web.
   6. Use the Environment drop-down menu to select the type of Ruby on Rails environment you wish to run.
   7. Click Create.

Once the application has been installed, you can activate your Ruby on Rails environment by clicking Run in the Available Ruby on Rails Applications table.

Creating a Rewrite

Because Ruby on Rails uses its own server, users visiting your website (and subsequently your Ruby on Rails application) will need to be redirected to the appropriate port.

Ruby does not respond on the standard HTTP port number, 80. Thus, visitors would need to specify the port number with the domain — for example, example.com:12001.

PICK Remember: Ruby application port numbers increment automatically with every new application. This means that, if you are on a shared server, you will simply be assigned the next available port number. Your first application will not necessarily run on port 12001.

To configure Ruby to respond without visitors having to specify a port number, you will need to configure a rewrite.

To configure a rewrite:

   1. Log into cPanel.
   2. Navigate to the Software/Services section of your cPanel interface.
   3. Click the Ruby on Rails icon.
          * This step will open the Ruby on Rails management interface.
   4. Click the Create Rewrite button corresponding to the appropriate application in the Create A Rewrite table.
   5. From the drop-down menu, select the domain, subdomain, or addon domain on which you wish to run your Ruby application.
          * If you wish to run the application from a new page within your domain, type the page name you wish to use into the available text field.
   6. Click the Save button.

Additional Applications and Rewrites

If you intend to run multiple Ruby applications, you will need to configure additional ports to respond using Ruby on Rails and, if necessary, additional rewrites to disguise the port change. To do so, simply add an application as described in the Deploying a Ruby on Rails Environment section. By default, the new application will respond on the next available port number — for example, if your first application runs on port 12001, the second may run on port 12002 or higher.

Remember: Ruby application port numbers increment automatically with every new application. This means that if you are on a shared server you will simply be assigned the next available port number. Your first application will not necessarily run on port 12001. This also means that your application port numbers may not be consecutive.

To configure an additional rewrite, simply follow the steps outlined above. You will need to use a new domain, addon domain, subdomain, or page (for example: example.com/RubyApplication) for the rewrite. You will not be able to configure 2 Ruby applications to respond on the same domain, subdomain, addon domain, or page.

 

 

Was this answer helpful?

 Print this Article

Also Read

Perl Troubleshooting

IMPORTANT: This information is provided for advanced users only. Support cannot advise users on...

PHP Troubleshooting

IMPORTANT: This information is provided for advanced users only. Support cannot advise users on...