Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Managing Rails Versions and Gems- Automatically load required version using RVM

    • 0
    • 1
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 142
    Comment on it

    If you are using rvm and want to load project specific ruby version and gems automatically when you access the project directory, for this you can use a very simple command

    rvm --create --ruby-version use ruby-version-number@gemsetname
    

    example

    rvm --create --ruby-version use ruby-2.2.0@findnerd
    

    If you want the gems to be loaded from the global gemset then in that case

    rvm --create --ruby-version use ruby-2.2.0
    

    By using this command you wont have to use rvm command to load a particular gemset or ruby version and you can manage different projects running on different ruby and rails version simultaneously.

    Behind the scenes

    It basically creates two files -

    1 - A .ruby-version file that contains the required ruby version "ruby-2.2.0"

    2 - A .ruby-gemset file that contains gemset name in this case "findnerd".

    which basically tells rvm to load the required configuration.

    I hope this helps anyone trying to cope up with multiple versions of ruby,rails or gem versions.

 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: