Friday 18 May 2012

Using RVM with different versions of Rails on Mac OSX

I had to use both jRuby and Ruby with different versions of Rails on the same machine which turned out to be quite a frustration. I've heard about RVM which separates Ruby environments together with their gems from one another. I decided to give it a shot...
RVM installation (stable version)
  1. first lets install the RVM
    curl -L get.rvm.io | bash -s stable 
  2. after installation we'll have to reload the console and run:
    source ~/.rvm/scripts/rvm
  3. test if everything was OK
    type rvm | head -n 1 
    to get the message rvm is a function
Ruby installation 

I will be using jRuby 1.6.5 and Ruby 1.9.3 so we need to install those two:
rvm install  1.6.5
rvm install  1.9.3 
After installations finish, run rvm list to get the list of installed rubies.
I will use jRuby and set it as default as I use it most of the time:
rvm use 1.6.5 --default

Rails installation

First we'll need Gemsets. They can be regarded as folders with separate ruby setups, gems and irb, all separate and self-contained - from the system, and from each other.
Lets create one for the Rails we require 2.3.8
rvm gemset create rails238
rvm use 1.6.5@rails238

To install rails and remaining gems we can use gem install but since I use geminstaller we can just run this gem and it does the job for us.
gem install geminstaller
geminstaller

Before we can start anything we have to set path for our new jRuby in .profile and refresh it
with source ~/.profile.
At the end we can override rvmrc to load this gemset automatically:
rvm --rvmrc --create 1.6.5@rails238

For Rails 3.2, which I will use with Ruby,  the gemset stuff is same as before except I'll use bundle install.

We'll these are my notes for RVM installation. Off to checkout Pry, heard it's way better than IRB....

30 comments:

  1. I was looking for this certain information for a long time. Thank you and good luck.
    Python training in usa
    Python training in marathahalli
    Python training in pune

    ReplyDelete
  2. Thanks for the good words! Really appreciated. Great post. I’ve been commenting a lot on a few blogs recently, but I hadn’t thought about my approach until you brought it up. 

    Devops training in sholinganallur

    ReplyDelete
  3. This is an awesome post.Really very informative and creative contents. These concept is a good way to enhance the knowledge.I like it and help me to development very well.Thank you for this brief explanation and very nice information.Well, got a good knowledge.
    Blueprism training in marathahalli

    Blueprism training in btm

    Blueprism online training

    ReplyDelete
  4. Hello! This is my first visit to your blog! We are a team of volunteers and starting a new initiative in a community in the same niche. Your blog provided us useful information to work on. You have done an outstanding job.

    AWS Interview Questions And Answers

    AWS Training in Bangalore | Amazon Web Services Training in Bangalore

    Amazon Web Services Training in Pune | Best AWS Training in Pune

    ReplyDelete
  5. In the beginning, I would like to thank you much about this great post. Its very useful and helpful for anyone looking for tips. I like your writing style and I hope you will keep doing this good working.
    Angularjs Coaching in Bangalore
    Angularjs Institute in Bangalore
    Best Angularjs Training in Bangalore
    ccna Classes in Bangalore
    ccna Coaching Centres in Bangalore
    ccna Certification Course in Bangalore

    ReplyDelete
  6. Great blog!!! It was very impressed to me. I like so much and keep sharing. Thank you.

    Article submission sites
    Education

    ReplyDelete
  7. Interesting information and attractive.This blog is really rocking... Yes, the post is very interesting and I really like it.I never seen articles like this. I meant it's so knowledgeable, informative, and good looking site. I appreciate your hard work. Good job.
    Kindly visit us @
    Sathya Online Shopping
    Online AC Price | Air Conditioner Online | AC Offers Online | AC Online Shopping
    Inverter AC | Best Inverter AC | Inverter Split AC
    Buy Split AC Online | Best Split AC | Split AC Online
    LED TV Sale | Buy LED TV Online | Smart LED TV | LED TV Price
    Laptop Price | Laptops for Sale | Buy Laptop | Buy Laptop Online
    Full HD TV Price | LED HD TV Price
    Buy Ultra HD TV | Buy Ultra HD TV Online
    Buy Mobile Online | Buy Smartphone Online in India

    ReplyDelete
  8. It is really great to know you being a responsible writer did take care about the information you have provided in this article. This is elegantly prepared and well-written in my opinion.
    SAP training in Mumbai
    SAP course in Mumbai
    SAP training institute Mumbai

    ReplyDelete
  9. I really inspired by seeing such great information about digital marketing. You explained the services of digital marketing very well. After reading your article I was amazed. I know that you explain it very well. And I hope that other readers will also experience how I feel after reading your article Data Science Training In Chennai | Certification | Data Science Courses in Chennai | Data Science Training In Bangalore | Certification | Data Science Courses in Bangalore | Data Science Training In Hyderabad | Certification | Data Science Courses in hyderabad | Data Science Training In Coimbatore | Certification | Data Science Courses in Coimbatore | Data Science Training | Certification | Data Science Online Training Course

    ReplyDelete
  10. I was basically inspecting through the web filtering for certain data and ran over your blog. I am flabbergasted by the data that you have on this blog. It shows how well you welcome this subject. Bookmarked this page, will return for extra. data science course in jaipur

    ReplyDelete
  11. I am truly getting a charge out of perusing your elegantly composed articles. It would seem that you burn through a ton of energy and time on your blog. I have bookmarked it and I am anticipating perusing new articles. Keep doing awesome.
    data science coaching in hyderabad

    ReplyDelete
  12. Manage the facts like sale, credits, debits. This is easy software which is perfect for all users involved in improved business organization, improved secretarial. Tally ERP 9 With Crack Full Version Zip Download

    ReplyDelete