Ruby gem search: show all remote versions

Tired of the privacy invasion of browsers? Worried about the risk of seeing ads everywhere? Give the Brave Browser a try. All Chrome extensions are compatible. None of the telemetry. Auto-blocks ads and still support content creators like me.

Download the Brave browser now »

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.