What is the syntax for `gem install` multiple gems, specifying versions for each one?

StackOverflow https://stackoverflow.com/questions/23213849

  •  07-07-2023
  •  | 
  •  

Question

How can I use gem install to install multiple gems at the same time, while also specifying the versions I want?

Example:

gem install akami -v  1.2.0 --ignore-dependencies
gem install atomic -v  1.1.14 --ignore-dependencies
gem install aws-s3 -v 0.6.2 --ignore-dependencies
gem install backports -v  3.3.0 --ignore-dependencies
gem install brendanlim-sms-fu -v 1.0.0 --ignore-dependencies
gem install builder -v  3.1.3 --ignore-dependencies
gem install capistrano -v  2.9.0 --ignore-dependencies

How could I instruct gem install to execute that in one line?


The accepted answer do answer the question. But the final approach I took was to use bundler 1.0.22, which is compatible with ruby 1.8.6.

Was it helpful?

Solution

Since Rubygems 2.0 you can specify a version for multiple package installations like this:

$ gem install akami:1.2.0 atomic:1.1.14 aws-s3:0.6.2 backports:3.3.0 \
brendanlim-sms-fu:1.0.0 builder:3.1.3 capistrano:2.9.0 \
--ignore-dependencies
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top