Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How do I check which version of rubygems i have installed on my ubuntu box?

share|improve this question
up vote 1 down vote accepted

Just an idea, list the installed packages and grep for ruby or gems or whatever :)

dpkg --get-selections

share|improve this answer
Wouldn't it be better to ask for a specific package? Like dpkg -l rubygems – ptman Mar 24 '10 at 13:44
What if you don't know the package name ? does this work : dpkg -l *ruby* ? – Jimmy Mar 24 '10 at 13:49
@user123456 dpkg -l | grep ruby would work in that instance. – voretaq7 Jul 26 '12 at 1:05

Either gem -v or gem --version would output the version number.

For more information:

$ gem -h
RubyGems is a sophisticated package manager for Ruby.  This is a
basic help message containing pointers to more information.

    gem -h/--help
    gem -v/--version
    gem command [arguments...] [options...]

    gem install rake
    gem list --local
    gem build package.gemspec
    gem help install

  Further help:
    gem help commands            list all 'gem' commands
    gem help examples            show some examples of usage
    gem help platforms           show information about platforms
    gem help <COMMAND>           show help on COMMAND
                                   (e.g. 'gem help install')
    gem server                   present a web page at
                                 with info about installed gems
  Further information:

I've seen on another question that you have the gem app broken. And that you have updated it with gem update --system. If this is the case, you can look on /usr/lib/ruby/gems/1.8/gems/rubygems-update-x.x.x and take the directory with the highest value of x.x.x.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.