RubyRedGrapefruit
RubyRedGrapefruit

Reputation: 12224

bundler ruby process burns at 99% CPU on Mac when upgrading from Rails 3.0.9 to 3.1.0

I have tried this a couple of times now. I use rvm and the ruby I'm using is ree 1.8.7. Running "bundle update" after changing my Gemfile hangs the processor at almost 100% CPU. It has been running for over an hour. Is there something special I need to do?

Upvotes: 3

Views: 1738

Answers (1)

sujal
sujal

Reputation: 1605

I figured out how to debug this and was thus able to resolve my issues.

Short version (based on my admittedly superficial knowledge of bundler):

  • bundle update or bundle install both look at your Gemfile and then try to resolve dependencies for the specified gems. This is the step that's causing your CPU to burn, most likely (it should be after it prints Fetching source index for http://rubygems.org/)

What I've run into is that sometimes Bundler gets stuck in an infinite loop (or, at least longer than I've waited) trying to resolve conflicting requirements. In my case, it was that two different gems both required a third gem with differing version requirements.

For some reason, bundler was getting caught in an unending loop (or in some very, very long loop) trying to resolve dependencies.

I basically found this issue on github: https://github.com/carlhuda/bundler/issues/1450

which led me to try this command:

DEBUG_RESOLVER=1 bundle install

Running that produced enough output for me to identify the gem dependency that was confusing bundler. In my case, it was two different gems requiring different versions of the builder gem.

I fixed it by specifying the version of builder that would work for both gems:

gem 'builder', '~> 3.0.0'

That sorted it out, and the next time I ran install or update, it completed in a reasonable time.

I hope that helps you figure out your issue.

Upvotes: 6

Related Questions