rubygems / bundler

Manage your Ruby application's gem dependencies
https://bundler.io
MIT License
4.88k stars 2k forks source link

Extreme slow performance (possibly infinite) on particular Gemfile #1099

Closed jacquescrocker closed 11 years ago

jacquescrocker commented 13 years ago

Using the following Gemfile:

source 'http://rubygems.org'

gem "i18n", ">= 0.4.0"

gem 'rails', '3.0.5'

gem "haml", ">= 3.1.0.alpha.36"
gem "sass", ">= 3.1.0.alpha.252"

gem "compass", ">= 0.11.beta.5"

gem "daemons", ">= 1.1.0"

gem "bson", "1.2.1"
gem "bson_ext", "1.2.1"
gem "mongo", "1.2"
gem "mongoid", ">= 2.0.0.rc.8"
gem 'mongoid_slug', :require => 'mongoid/slug'

gem "rails_config", ">= 0.2.1"

gem "useragent"
gem "viewfu", ">= 1.0.1"

gem 'validate_email'

gem "guid"

gem "redis"
gem "resque"

gem "formtastic", :git => "https://github.com/justinfrench/formtastic.git"

gem 'rmagick'

# for markdown rendering
gem "rdiscount"
gem "sanitize"

gem "s3", ">= 0.3.7"

# asset packaging
gem "barista", ">= 1.0.0"
gem "jammit", ">= 0.6.0"
gem "jammit-s3", ">= 0.6.0"

# sprite
gem "sprite", ">= 0.2.2"

# api helpers
gem "pusher"

group :development do
  # shows growl notifications if coffeescript
  gem "barista_growl", ">= 0.1.0"
  gem "heroku-rails"
end

group :development, :test do
  gem "ruby-debug", :platforms => :mri_18
  gem "ruby-debug19", :platforms => :mri_19
  gem "thin"

  gem "therubyracer", ">= 0.8.0.pre3", :require => "v8"
  gem "fabrication"
  gem 'ffaker'

  gem "rspec-rails", ">= 2.5.0"
  # gem 'cucumber-rails'
end

group :test do
  gem "autotest"

  gem "remarkable_mongoid"
  gem 'capybara'
  gem 'webrat'

  gem "webmock"
  gem "vcr"

  gem "pickle"

  gem "launchy"

end

when I create a new gemset (on Ruby 1.9.2p180 and bundler 1.0.10), and run bundler it takes forever to resolve. I left it going for a few hours and it still was working.

Now using gemset 'test_bundler'
[jc@macbookpro ~/tmp/test_bundler]# bundle
Fetching https://github.com/justinfrench/formtastic.git
remote: Counting objects: 7665, done.
remote: Compressing objects: 100% (3752/3752), done.
remote: Total 7665 (delta 4958), reused 5902 (delta 3576)
Receiving objects: 100% (7665/7665), 1.14 MiB | 559 KiB/s, done.
Resolving deltas: 100% (4958/4958), done.
Fetching source index for http://rubygems.org/
jacquescrocker commented 13 years ago

I think this performance issue (or infinite loop) is related to the groups. when i remove the groups on the gemfile, it resolves in a couple minutes

radar commented 12 years ago

You shouldn't be using >= for gem dependencies, as that may result in a large dependency collection that Bundler has to cycle through. It's better to use ~> for these kinds of things.

Is this still an issue with Bundler 1.1?

mscottford commented 11 years ago

This did take a few minutes to finish, but finish it did. https://gist.github.com/4689009

It gave a bunch of warnings about "illformed requirements". My guess is that was the source of the original problem. Following @radar's advice should speed things up, but if you are still running into issues, please open up a different issue with the revised Gemfile.