Ruby On Rails Installation on Ubuntu 14.04

Source: Installing Ruby on Rails on Ubuntu 14.04 – 15.10 and Install Ruby on Rails · Ubuntu Linux.

Installation:

  1. Install Ruby Version Manager (RVM). I already had ‘curl’, so import the rvm.io public key in the server system.


     
  2. Then download the RVM installer with curl and execute it (by piping the curl output to bash):

    KEEP IN MIND THIS LINE

    I need to execute ‘source /home/teddy/.rvm/scripts/rvm’ to build the RVM environment and to save the settings of this environment into current shell.

    NOT (ref: Error message: -bash: /etc/profile.d/rvm.sh: No such file or directory)

     
  3. Install the Ruby dependencies with the RVM command below:

    For the first time, I got some errors like this:

    SOLUTION: ref: Error installing Ruby on Ubuntu 14.04
    I have to fix/remove some failed ubuntu repository. From ‘sudo apt-get update’, I got these repositories error:

    After fixing them (see the above link), it’s working fine

     
  4. Check for available Ruby versions
    The following command lists the available ruby versions:

    I’m going to install the latest stable ruby version 2.3.3 because ruby 2.4.0-rc1 still in release candidate.
  5. Install Ruby Version
    Using RVM makes the independent management of ruby versions an easy process. The command listed below installs the Ruby version 2.3.3.

     
  6. Default Ruby Version must be Set up
    In order for the applications to use Ruby, the default ruby version needs to be set. The following command sets Ruby 2.3.3 as default version.
  7. Confirm ruby version installed

    We’ve just finished installing ‘Ruby’. Now we’re going to install ‘Rails’
  8. Installing Rails
    Rails can be easily installed with the Ruby gem installer.
  9. Check the rails version
    Execute the following command to check the rails version and to see if rails has been installed successfully.

    I just installed the latest rails (version 5.0.1). To install certain version (like version 4.2.5), install rails like this:

     
  10. Create a test app ‘testapp’ in Document/rubyonrails/ directory


     
  11. Go into the ‘testapp’ then start the rails server

     
  12. Open it on your browser http://localhost:3000/. If nothing wrong, here is the looksfront-page-testapp

Leave a Reply

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