Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make "bundle install" run faster

When I need to add a new dependent gem in the Gemfile, then run "bundle install" it seems to take forever (sometimes 7 minutes for me). How can I make this process faster?

I did a search on the web, and it mentioned a Gemfile.lock file. That is appearing for me in my local directory. But running "bundle install" still takes forever.

I've been learning Ruby on Rails for the past 2 weeks (so forgive the newby question, if the answer is obvious).

like image 442
Chris Avatar asked Mar 08 '11 00:03

Chris


People also ask

How do I fix a run bundle to install missing gems?

Select Tools | Bundler | Install from the main menu. Open the Gemfile, place the caret at any highlighted gem missing in the project SDK and press Alt+Enter . Select Install missing gems using 'bundler' and press Enter .

What is the difference between bundle install and bundle update?

lock . In general, you should use bundle install(1) to install the same exact gems and versions across machines. You would use bundle update to explicitly update the version of a gem.

What is bundle install?

bundle install is a command we use to install the dependencies specified in your Gemfile.

What does bundle update -- bundler do?

bundle update is a command provided by the Bundler gem which will update all your gem dependencies to their latest versions. Providing you have a Gemfile. lock pre-existing, running bundle install will only install the versions specified in the Gemfile.


2 Answers

It sounds like they have made some changes in bundler 1.1 that are going to give some speed improvements so I would start by trying that:

mike@sleepycat:~$ sudo gem install bundler --prerelease
Fetching: bundler-1.1.pre.1.gem (100%)
Successfully installed bundler-1.1.pre.1
1 gem installed
like image 163
mikewilliamson Avatar answered Oct 10 '22 22:10

mikewilliamson


This is "normal" behavior and is a pretty common complaint. Thoughtbot recently wrote a blog post that detailed the issue and has some suggestions on how to speed things up.

http://robots.thoughtbot.com/post/2729333530/fetching-source-index-for-http-rubygems-org

like image 38
Peter Brown Avatar answered Oct 10 '22 22:10

Peter Brown