How to Call an Older Version of a Gem from the Commandline

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


somegem _0.10.5_ /path/to/dir

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

How to run a specific version of a ruby gem

I can't reproduce this issue, but I can think of a few reasons why this might happen:

  • Bundler artifacts (perhaps in .bundle/) pointing to the old version. Try running in a different directory and see if it still happens
  • A bug in RubyGems (try gem update --system)
  • During install, it asked if you wanted to replace the brakeman binary and you selected "no"
  • If you are using a Ruby version manager, maybe one version is on a different path than another (like a system gem versus one managed by rvm)
  • Any number of GEM_PATH, bundler, gem, rvm weirdness that sometimes occurs

In any case, if I were you I'd gem uninstall brakeman, remove all versions, and install fresh. If you are using rvm, start with a fresh gemset or rvm gemset empty the current one.

Ruby: How to install a specific version of a ruby gem?

Use the -v flag:

$ gem install fog -v 1.8

How do I activate a different version of a particular gem?

If your problem is to run binaries of a certain version, then:

rails --version # => the latest version
rails _2.3.10_ --version # => Rails 2.3.10

This pattern (gem-binary _gem-version_) works for any gem binary.

Hope it helps.

How to switch cocoapods (or other gem) version on command line?

You can do the following to use different versions:

pod _0.34.4_ install 

or

pod _0.34.1_ install

Add gem to gemfile with bundler from command line

If you visit this question in 2018, bundler now has a cli to do this:

bundle add <gem-name> <version>

Version string could be your typical gem version including >= and ~



Related Topics



Leave a reply



Submit