I made similar question for npm here: npm equivalent of `pip install -r requirements.txt`
This is for gem.
What are the gem equivalent of:
pip freeze > requirements.txt
pip install -r requirements.txt
I made similar question for npm here: npm equivalent of `pip install -r requirements.txt`
This is for gem.
What are the gem equivalent of:
pip freeze > requirements.txt
pip install -r requirements.txt
There isn't a direct comparison in Ruby, but we have something very similar. Look at the bundler gem for how to write your list of required gems into a Gemfile and automatically generate a Gemfile.lock which contains the current versions installed.
My solution is:
serverA: $ gem list | awk -F'[ ()]' '{print $1" -v "$(NF-1)}' > gem_reqs.txt
serverB: $ cat gem_reqs.txt | xargs gem install
My situation was. On server "A" I have 3rd party developed ruby scripts with many dependencies and no Gemfile. I have to use those same ruby scripts on server "B". How can I easily "copy" ruby env with all possibly required gems to server "B" (same versions).