Ruby gem search: show all remote versions

Want to help support this blog? Try out Oh Dear, the best all-in-one monitoring tool for your entire website, co-founded by me (the guy that wrote this blogpost). Start with a 10-day trial, no strings attached.

We offer uptime monitoring, SSL checks, broken links checking, performance & cronjob monitoring, branded status pages & so much more. Try us out today!

Profile image of Mattias Geniar

Mattias Geniar, March 30, 2016

Follow me on Twitter as @mattiasgeniar

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.



Want to subscribe to the cron.weekly newsletter?

I write a weekly-ish newsletter on Linux, open source & webdevelopment called cron.weekly.

It features the latest news, guides & tutorials and new open source projects. You can sign up via email below.

No spam. Just some good, practical Linux & open source content.