Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I call an older version of a gem from the commandline?

Tags:

ruby

rubygems

Say I have two versions of a gem installed (somegem versions 0.10.6 and 0.10.5) and I want to run the earlier version from the commandline. Do I have to uninstall the newer version? Is there a way I can use a flag to specify which version I want to use? Something like...

somegem /path/to/dir --version 0.10.5 

I checked the rubygems documentation, and it only describes how to use a specific version when you require a gem from a file, but nothing about how to do it from the commandline.

like image 401
picardo Avatar asked Oct 31 '10 02:10

picardo


People also ask

How do I install a specific version of a gem?

Use `gem install -v` You may already be familiar with gem install , but if you add the -v flag, you can specify the version of the gem to install. Using -v you can specify an exact version or use version comparators.

What is gem in command line?

The gem command allows you to interact with RubyGems. Ruby 1.9 and newer ships with RubyGems built-in but you may need to upgrade for bug fixes or new features. To upgrade RubyGems, visit the download page. If you want to see how to require files from a gem, skip ahead to What is a gem.

How do I check if I have the latest version of gems?

Using gem, the closest I can get is gem list -d [gemname] , which appears to list only the latest version installed.


1 Answers

somegem _0.10.5_ /path/to/dir 

No link to documentation, because apparently there isn't any.

like image 181
Jörg W Mittag Avatar answered Oct 22 '22 17:10

Jörg W Mittag