Its all about Ruby On Rails
Posts tagged installation
Ruby script to install bulk gems
Dec 8th
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.
Skiping installation of ri and RDoc documentation while installing gems
Dec 3rd
Probably most of the time you would like to skip ri and RDoc installation while installing some new gems, specially on production server.
I do like to skip ri and RDoc documentation while installing gems on my development machine, because it takes more time to generate ri and RDoc then actual installation of gem.
We can skip rdoc and ri documentation while installing a gem by:
gem install rails --no-ri --no-rdoc
I am sure that you would not like to give –no-ri and –no-rdoc every time you install a gem. To avoid this situation, you can create/update $HOME/.gemrc file with following option:
gem: --no-ri --no-rdoc
Now every time you install a gem, it will skip installation of ri and RDoc for the gem.
My .gemrc file looks like:
--- :update_sources: true :sources: - http://gems.rubyforge.org/ - http://gems.github.com :benchmark: false :bulk_threshold: 1000 :backtrace: false :verbose: true gem: --no-ri --no-rdoc
Leopard sucks while installing/updating gems
Aug 7th
May be you guys have noticed that when you try to install a new gem on your machine it says some thing like “Updating meta data for 500 gems” and display one dot per gem. These dots moves very slowly and stops in some time.
I faced this situation many times and found a solution some where on net. I don’t remember the link but it worked.
According to that, you just need to add:
require ‘resolv-replace’
as the first require in /usr/bin/gem file.
enjoy!!
