Ruby gem search: show all remote versions

Here’s a quick reminder on how to use Ruby gems at the command line to search for remote packages and show all their versions.

This example searches for a gem called “wkhtmltoimage-binary”. By default, it will tell you which is the latest version of that particular gem.

$ gem search wkhtmltoimage-binary

*** REMOTE GEMS ***
wkhtmltoimage-binary (0.12.2)

If you want to search all available versions, because you might need a very specific one, you can query Ruby Gems with --remote --all.

$ gem search wkhtmltoimage-binary --remote --all

*** REMOTE GEMS ***
wkhtmltoimage-binary (0.12.2, 0.12.1, 0.12, 0.11.0.1.1, 0.11.0.1)

And as a bonus, if you want to install a specific version, you can do so with the -v parameter.

$ gem install wkhtmltoimage-binary -v 0.11.0.1
Fetching: wkhtmltoimage-binary-0.11.0.1.gem (100%)
Successfully installed wkhtmltoimage-binary-0.11.0.1
...
1 gem installed

Done.