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
Convert an Array of Integers into an Array of Strings in Ruby
How to Write a Ruby Command Line App That Supports Tab Completion
Fastest Way to Check If a String Matches a Regexp in Ruby
Conditional Key/Value in a Ruby Hash
Why Does Accessing a Ssl Site with Mechanize on Windows Fail, But on MAC Work
Edit Each Line in a File in Ruby
What Is the %W "Thing" in Ruby
Safely Assign Value to Nested Hash Using Hash#Dig or Lonely Operator(&.)
Overriding the == Operator in Ruby
Undef - Why Would You Want to Undefine a Method in Ruby
Creating Routes with an Optional Path Prefix
How to Get Elapsed Time in Milliseconds in Ruby
Passing Headers and Query Params in Httparty
Ruby/Rails - .Each Iterator Is Printing Entire Array at the End of the Loop
Write CSV in Ruby 1.9 and CSV::Writer