Requirements for Ruby on Rails Hosting
There are a few major requirements for installing Ruby on Rails on a cPanel server. First, cPanel 11 must be running on the server. This can be verified by checking at the version number in the upper right-hand corner of WHM.
Installing Ruby on Rails in cPanel does require some command line interaction, so you will need to make sure that you can log into your server via SSH as root. Furthermore, cPanel requires that your server contain a working yum configuration. You can check this before trying to install Ruby by running yum list ruby from SSH, if it works without error, you should be fine.
Installation
The installation of Ruby on Rails in cPanel has two parts, first is installing Ruby itself, which can be accomplished by running /scripts/installruby . This script will install Ruby, RubyGems, Mongrel and the software that Ruby relies upon and activates the Ruby interface in your end user's cPanel.
The second step in the installation is running /usr/local/cpanel/bin/ror_setup . This script will setup Ruby on Rails so that it will be activated when your system starts.
Deploying a RoR hosting environment
Now that you have installed Ruby on Rails, you will want to deploy your first application environment.
Ruby on Rails works in a different manner from most of the web application languages used on cPanel servers. Ruby runs a separate server other than Apache for serving Ruby on Rails web applications, so setup for this requires a little more work. First you will need to login to your cPanel and click on the Ruby on Rails icon, to bring up the Ruby on Rails management interface that allows you to setup your Ruby environments. At this point, you will need to give your application a name and setup its path.
Note: If you set this path inside of your public_html directory your application's source code and configuration files can be viewable by anyone on the web.
Once you have deployed your first environment, we will of course want to turn it on by clicking on the run icon next to Application's Name in the Manage Ruby on Rails interface. If this worked successfully, you should see running under status, and you should be able to click the URL icon under the Rails Server column to see a page that looks similar to this:
This page means that the environment is up and running, and for the rest of your Ruby on Rails application installation you will need to consult the application's installation guide.
If you pay close attention to the URL used for the application, you will see that it has a number like :12001 at the end of it. This is because Ruby on Rails does not use the standard Apache web server, but rather uses its own, called Mongrel.
We can change these to be user-friendly. You will need to create a new subdomain or addon domain in cPanel, then click on the create rewrite button next to the Rails application name in cPanel, select the desired domain name from the drop down box, and now, whenever you go to this domain, it will display the RoR application.
Basic Ruby on Rails Troubleshooting
Since Ruby on Rails uses its own web server, it has to run this web server on an alternate port. This causes an issue if you are running a firewall on your system. You will need to ensure that ports 12001 and up are open (we recommend making the max number of the open ports 12001 plus whatever the number of Ruby applications you expect to be running will be).
Sometimes the gems repos will go down. If this happens during the installation, you will need to re-run /scripts/installruby.
To have your Ruby on Rails developed website and applications up and running on your very own VPS Hosting today click the order button below and follow our signup page.

Older news items: |