How to launch a specific version of a ruby ​​gem

I am running brakeman outside of my gemfile, so I am not using bundler.

If I do a gem list , I see I have the following for brakeman

 brakeman (3.3.3, 3.3.2, 3.1.4, 3.1.2) 

But if I do brakeman --version , I get

 brakeman 3.1.2 

therefore I do not use the latest version. If I do gem update brakeman or

 gem update brakeman, '3.3.3, 

I get

 Updating installed gems Nothing to update 

So, how do I run version 3.3.3 of Brakeman?

+7
ruby-on-rails rubygems brakeman
source share
3 answers

I cannot reproduce this problem, but I can give several reasons why this could happen:

  • Bundler artifacts (possibly in .bundle/ ) indicating the old version. Try running in a different directory and see if it all happens.
  • Error in RubyGems (try gem update --system )
  • During installation, he asked if you want to replace the brakeman binary, and you selected "no"
  • If you use the Ruby version manager, perhaps one version is on a different path than the other (for example, system pearls versus one, managed by rvm )
  • Any number of GEM_PATH , bundler , gem , rvm oddities that sometimes occurs

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

+3
source share

If you have several versions of gem installed and you want to invoke a specific version from the command line, you can use:

 brakeman _3.3.3_ [args go here] 

This does not apply to brakeman, you can do this for most other gems.

+9
source share
 $ gem install brakeman -v 3.3.3 

then in your Gemfile (if you have one) point to this particular version, for example:

 "brakeman", "~> 3.3.3" 
-2
source share

All Articles