Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • SETTING UP ROR FOR THE FIRST TIME ON A NEW UBUNTU SYSTEM USING RVM

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 310
    Comment on it

    1> We need to install RVM before we can install Ruby, because RVM is a version manager and it will help us to install & manage different versions of Ruby on the same system and easily switch between them.

    To install RVM we first need to download the signature & import it:

      curl -#LO https://rvm.io/mpapis.asc
      gpg --import mpapis.asc
    

    After downloading & importing the signature we can install RVM using:

      \curl -sSL https://get.rvm.io | bash 
    

    2> After the RVM has been installed successfully, we need to source the rvm scripts by typing:

       source ~/.rvm/scripts/rvm
    

    3> To confirm that RVM has been installed & to check its version we can type :

       rvm --version
    

    4> For installing latest stable version of ruby using RVM

       rvm install ruby
    

    5> To confirm that you have the latest version of ruby installed, you can type :

       ruby -v
    

    6> To view available ruby versions type:

       rvm list   
    

    7> By default 2 gemsets namely default & global are created. To view gemsets for the version of ruby installed by you,

       rvm gemset list   
    
       (gemsets for ruby-2.2.3 (found in /home/taran/.rvm/gems/ruby-2.2.3)
        => (default)
            global
       )
    

    8> To install rails version '4.2.0' in the default gemset for ruby-2.2.3 type:

       gem install rails -v 4.2.0 --no-ri --no-rdoc
    

    9> To verify that rails has been installed successfully, type:

       rails -v
    

    10> We are done with the installation of Ruby & Rails on a completely new system. In my case I installed ruby version (2.2.3) & rails version (4.2.0)


    11> As mentioned earlier we always have 2 gemsets automatically created for any version of ruby installed using RVM i.e default & global.
    In our case, we have installed Rails in the default gemset, we can switch to the global gemset to verify that it does not have rails installed in it.

    rvm use 2.2.3@global
       Using /home/taran/.rvm/gems/ruby-2.2.3 with gemset global
    ruby -v
            ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-linux]
    rails -v
            The program 'rails' is currently not installed. You can install it by typing:
            sudo apt-get install ruby-railties
    

    This clears that we installed rails in the default gemset not in the global gemset for ruby-2.2.3

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: