Installing Ruby on Rails 3 on Linux

Since the writing of this article our deployment methods for Ruby have changed. Please use the most up to date instructions on the following link for all new shared hosting accounts. Legacy shared accounts and VPS’s can continue to follow the original article.

GET RUBY ON RAILS UP AND RUNNING

 

Some Ruby applications require a version of Ruby on Rails that is higher than what is supported by cPanel. For these applications, you will need to install a different version of Ruby on Rails directly to your account. When you do so, however, you lose the ability to manage Ruby through cPanel and you will need to manage it through SSH. As such, this is considered an advanced task.

We have an automatically installer for multiple versions of Ruby as well as Ruby on Rails that you can run through SSH. It will ask you a few questions then ask you to restart your SSH session to proceed due to how the Ruby on Rails installation works.

Once you have gained SSH access (guide linked below) to your server, you will need to run the following command:

install_ror3

Once run, it will search for a current version of Ruby installed to your account. If one is found, it will ask if it’s ok to remove. It is recommended that you create a backup of this folder. Enter Y for yes and press enter.

[user@server ~]# install_ror3
* I found a Ruby installation at /home/user/.rvm. Would you like to continue? This will erase the current install.
Continue? [N]

The installation will proceed by installing the Ruby Version Manager then asking which version of Ruby to install. Enter a number for a selection and press enter (alternatively, simply pressing enter will select the default option).

* Installing Ruby Version Manager
* Step 1 complete.
Step 2 - Select a version of Ruby to install:
[1] Ruby 2.0 * Default
[2] Ruby 2.1
Select a version: [1] 1
* Installing Ruby 2.0. This may take some time (3 - 5 minutes), please wait...

After the installation of the selected Ruby version is completed, you will need to close your SSH session and open a new one to proceed.

Step 2 complete.
Step 3 - Install Rails
* This step is completed on next login. To continue, please close your SSH session and open a new one.
grison:/home/ror3test$ exit

When your new SSH session opens, installation will automatically proceed by asking you to select a version of Ruby on Rails to install. As before, enter a number for the version you want or simply press enter to use the default version.

Step 3 - Install Rails
* Please select a version of Rails to install.
[1] Rails 3.2.19 * Default
[2] Rails 4.0.0
[3] Rails 4.1.6
Select a version [1] 1
* Installing Rails 3.2.19. This will take some time (3 - 5 minutes), please wait.
* Installation complete.

Once the installation is complete, you can proceed with the installation instructions of your software of choice. Alternative, if you’d like to start a new application for development, executing the following command will create a blank application directory. In this example, our application is called hello_world and will be created in /home/USERNAME/hello_world.

rails new hello_world

Related Articles: SSH on Windows with Putty | SSH on Linux with Terminal

Looking for quality web hosting? Look no further than Arvixe Web Hosting!

Tags: , , , , , , , , , , | Posted under 3rd Party Software | RSS 2.0

4 Comments on Installing Ruby on Rails 3 on Linux

  1. Inquiring User says:

    Where to find the install_ror3 file. I am unable to locate.

  2. Polo says:

    I wanted to install Ruby locally, but create new apps under a new domain, how would I add new apps under the new domain hosted on my vps?

Leave a Reply

Your email address will not be published. Required fields are marked *