bundle install command on your terminal and wait for bundler to install the gems. Have you seen it to be pathetically slow.
It appears that RubyGems is slow. This is because of how Rubygems manages index of gems . It has 3 indexes:
- Index of new version of the gem
- Index of all the versions
- Index of pre release
gem install , fetches the index of the latest version of the gem. Apparently, bundler downloads all the indexes. These indexes are gzipped and Marshal’d array of gem name, version and platform. Parsing this huge array is the first spot of slow down.
Now as we know bundler has intelligent algorithm for dependency management, which means when we do
bundle install, it will install all dependencies of the gem. This is achieved via
.gemspec file which bundler downloads unzips and UnMarshal.
To reduce the slowness there few options, lets explore them:
vendor/cache- force bundler to install from local cache then going across the wire
- have your gems in
Gemfileto be locked to a version or use PessimisticVersionConstraint.
I have used a combination of both and found substantial improvement in the time taken by
Keeping a watch on gemcutter mailing list for better ways of doing this.