Skip to main content

Deals You Can't Miss

1 Year Subscription

FAQ on RVM - Ruby Version Manager

How do I manage different versions of Ruby and its associated gems in my system? The obvious answer is RVM. I have been using it for quite a while now and started to put the frequently used commands (fuc) and questions that keep cropping up in my mind in this page. I should come handy as cheatsheet or whatever when I need to quickly get the answer. I very humbly acknowledge that I have been perusing for answers at but felt the need for a one-stop-page to look for quick answers. So did this page happen. I will keep updating this page with all relevant questions/problems that I have/faced possibly with right answers/solutions.
  1. What is the command to know if RVM is currently loaded in the opened shell?
    $ type rvm | head -n1 (If this shows "rvm is a function", you're good to go)  
  2. What is the command to install a specific version of Ruby, say 1.9.1?
    $ rvm install 1.9.1
  3. What is the command to use a specific version of ruby installed in rvm, let's say Ruby 1.9.1?
    $ rvm use 1.9.1 or equivalently
    rvm 1.9.1
  4. What is the command to find the version of Ruby currently in use by rvm?
    $ ruby -v
  5. What is the command to show currently installed rubies?
    $ rvm list
  6.  Output will be something like below (where => denotes the ruby that is currently being used by ruby):
       rvm rubies
             jruby-1.3.1 [ i386-java ]
             jruby-1.5.2 [ i386-java ]
       => ruby-1.8.7-p302 [ i386 ]
             ruby-1.9.1-p378 [ i386 ]
  7. What is the command to find the installation directory of Ruby in use?
    $ which ruby
  8. What is the command to use any Ruby not managed by RVM?
    $ rvm system
  9.  The above command tells the current shell to act as if you haven't run any "rvm use" commands yet.
  10. What is the command to make one specific version of Ruby as default when a new terminal shell is opened?
    $ rvm --default ruby-head
  11. What is the command to switch to RVM's user chosen default ruby?
    $ rvm default
  12. What is the command to find which version/flavour of Ruby/JRuby is the default?
    $ rvm list default
  13. What is the command to display Ruby information for the current shell?
    $ rvm info
  14. What is the command to switch to gems directory for current ruby?
    $ rvm gemdir
  15. What is the command to switch to the system gems directory?
    $ rvm gemdir system
  16. What is the command to switch to the system user's gems directory?
    rvm gemdir system user
  17. What is the command to reset to pre-RVM state?
    $ rvm reset
  18. What is the command to uninstall RVM installed, say,1.8.7 version of Ruby?
    $ rvm uninstall 1.8.7
  19. What is the command to install gems from system gem dir (osx: /Library/Ruby/Gems/1.8) using current ruby?
    $ rvm system ; rvm gemset export system ; rvm 1.8.7 ; rvm gemset import system
  20. [More to come...]

My Popular Posts

Ten Commandments of Egoless Programming

We are nothing but the values we carry. All through my life thus far, I tried to influence people around me with the virtues I value. Thanks to some good reading habits I had inculcated, and the fortune of being in good community of peers and mentors alike, I managed to have read some real good books. This post is about the 10 commands of egoless programming in Weinberg's book. I shall explain the commandments based on my experience here. So very many decades ago, Gerald M. Weinberg authored  The Psychology of Computer Programming . In it, he listed The Ten Commandments of  Egoless Programming , which remains relevant even today for us as not just programmers but as team-members. Weinberg is regarded as a pioneer in taking a people-centric approach to computing, and his work endures as a good guide to intelligence, skill, teamwork, and problem-solving power of a developer. When they appear to inspire and instruct, we find that they can apply to just about every business area, and e

Should I buy refurbished laptop from Amazon?

This post is based on my experience with and guess it to be true on all other platforms as well. At least you can check out and verify for these pointers before you make that decision to buy renewed/refurbished laptop on Amazon with your hard earned money. I see this question propping up in several forums and on many different occasions. In the recent past, I had my 5 year old dell laptop that gave up because its motherboard failed. One of the options that I had in my mind was to re-use the HDD and the 16GB DDR4 RAM of that old laptop in the one that I purchase next as secondary.  I had come to a conclusion that it is not worth buying a refurbished/renewed laptop at all. Why? For the following reasons, most of which I see as BIG #RedFlags: You got to remember that Amazon provides a platform for 3rd party sellers to sell their products as well. So in your search for refurbished laptops you wouldn’t want to choose some random 3rd party seller who Amazon doesn’t endorse. You cou

Multi-tenant Architectures

  Multi-tenancy Application Deployment Architecture could be modeled in 4 broad ways: Separate Apps & Separate Databases Shared Apps & Shared Databases Separate Apps & Shared Databases Shared Apps & Separate Databases There is no right or wrong here. It's about choice and consequence that you should consider taking into your business context and constraints. In this post I intend to jot down a some key points to keep in mind for each of these multi-tenant architecture. These are more of quick notes for my quick reference, a cheat-sheet of sorts when I have to make choices. And I guess this can come handy to you too in your wise decision making. Separate Apps & Separate Databases Easiest to implement from development and deployment stand-point. Just automate the deployment infrastructure for every tenant for quick set-up. Most expensive of all the models from infrastructure cost stand-point. Relatively longer deployment t