67

Is there a way via CLI to determine which version number of a gem is installed on my machine? Similar to yolk -l for python?

I'm trying to see if I have the latest version of compass / sass / zurb foundation. I have a dependency that requires a particular version number. So I need to see what version it is.

4
  • Off-Topic: wth is yolk? Sounds like a knock-off pip!
    – Oli
    Feb 22, 2013 at 16:19
  • @Oli yolk is a python package that shows you what packages are installed in your virtualenv (I don't know anything about python)
    – chrisjlee
    Feb 22, 2013 at 16:22
  • @Oli but it won't show what version number :(
    – chrisjlee
    Feb 22, 2013 at 16:33
  • possible duplicate of: stackoverflow.com/questions/1112754/… Sep 2, 2014 at 7:27

7 Answers 7

95
gem list

should give you a list of all your gems with version number in brackets behind it

0
14

StackOverflow has the answer and it might be a more useful place (for you) for Ruby architecture questions (they're still welcome here)

gem outdated

Not being a Ruby dev or having any gems installed, I'm not sure this is going to give you exactly what you're after but it should show you which ones need attention.

Otherwise I would have suggested gem query <package> (searches local) and gem query --remote to see available versions. If you only need local gem versions, the first aught to do.

11

If your gem's name is compass, then you could run:

gem list | grep compass

It will give you a list of gems, containing the phrase compass, and corresponding versions.

1
9

You can do it like this:

bundle info { gem name }

Or look in Gemfile.lock:

grep { gem name } Gemfile.lock
5

To add to @Belogron’s answer you can use

gem list MyGem

To list the installed versions of MyGem

You can then type

gem which MyGem

To display the specific version that is being used.

2

You can do it as follow:

bundle info <gem name>

0
gem -v

It works for me. Checked in deepin 15.9.1(debian distro)

1
  • What does this do? Aug 30, 2020 at 0:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .