Resolver Stuck in Infinite Loop

Skip to first unread message

Andrew Selder

Nov 8, 2010, 6:40:47 PM11/8/10
to ruby-bundler
I'm attempting to transition our project to bundler, and 'bundle
install' was taking forever (literally... hadn't finished in 2 hours),
so I poked around the code a little.

After setting DEBUG_RESOLVER to true, I seem to have traced the

My Gemfile includes:
gem 'metric_fu', ">= 1.4.0"
which is fine and activates metric_fu 1.5.1, and add it's dependencies
to the list.

Metric _fu 1.5.1 depends on chronic (>= 0.2.3), and churn (>= 0.0.7).
So the resolver dutifully installs chronic 0.3.0 and moves on to churn
and installs churn 0.0.12. Churn 0.0.12 also depends on chronic, but
with the specification (~> 0.2.3).

The resolver then tries to install chronic, but fails because it has
already installed 0.3.0. and says jumping to churn. It then works
backward trying every version of churn between 0.0.12 and 0.0.7, and
then looks like it starts back on churn again.

Adding a simple "gem chronic, '0.2.3'" to the Gemfile before the
metric_fu line allowed the "bundle install" command to complete in
about 2 minutes.

Here's the original Gemfile:
Here's the output from the shell with DEBUG_RESOLVER turned on:

Bundler 1.0.3
Ruby 1.8.7 p 174

Andrew Selder

Nov 8, 2010, 7:32:15 PM11/8/10
to ruby-bundler
I have an easier example case:

create an empty directory, switch to it, and run "bundle init".
Add "gem 'metric_fu'" to the new Gemfile
run 'bundle install' -> infinite loop
Reply all
Reply to author
0 new messages