Recently I had to setup many rails servers and for that I had to install some gems again and again by issuing traditional “gem install xyz” command several times. This was actually very annoying.
To avoid issuing “gem install xyz” command again and again, while setting up new machine, I wrote a utility script in ruby. This script read a list of gems and install them by avoiding ri and rdoc installation for gem.
This script saved lots of my time. Here is the Ruby script to install bulk gems, if you would like to give it a try.
Download this script and save as .rb. Run this script by “ruby install_gems.rb” and follow the instructions on screen.
Thanks for the script. Saved me a lot of time. Though didn’t work well for libxml-ruby, mysql, and rmagick but that was due to missing dependencies on my server.
~ Amit
You might have some libs missing on your server.
Hi Akhil,
I tried your script by including the versions for the gems and it is not allowing.
Have you got an updated script which allows the version as well.
–Sharath
[…] Akhil Bansal conta que recentemente preparou vários servidores com Rails, tendo que instalar algums gems pelo […]
Hi there, simply changed into aware of your blog thru Google, and found that it is really informative. I’m going to watch out for brussels. I’ll be grateful if you happen to continue this in future. A lot of other people can be benefited out of your writing. Cheers!
On UNIX box, you could just save list of your gems into text file and do this:
cat ruby_requirements.txt | xargs gem install
I tried it and it seems to work properly.