Ruby: How to Install a Specific Version of a Ruby Gem

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

Use the -v flag:

$ gem install fog -v 1.8

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.



Related Topics



Leave a reply



Submit