Search code examples
ruby-on-railsrubyruby-on-rails-3bundler

Rails3 and Bundler 1.0.0


I've just spent the past two days going around and around in circles. I'm upgrading an app from Rails 2.3.12 to Rails 3.0.0. It's on ruby 1.9.3.

I'm slowly working my way through the vendor/plugins and updating them to the relevant gems.

My problem is this: when I try to run the server I get this error:

/Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/rack-1.2.8/lib/rack/builder.rb:35: stack level too deep (SystemStackError)

After a lot of searching around I understood that this is probably because I am running an old version of Rack (1.2.8). I then tried to update this and I get this error:

Bundler could not find compatible versions for gem "bundler":
  In Gemfile:
    bundler (~> 1.0.0) ruby

  Current Bundler version:
    bundler (1.8.2)

This Gemfile requires a different version of Bundler.
Perhaps you need to update Bundler by running `gem install bundler`?

Why do I specify bundler (~> 1.0.0) in my Gemfile? Because of this error:

Bundler could not find compatible versions for gem "bundler":
  In Gemfile:
    rails (= 3.0.0) ruby depends on
      bundler (~> 1.0.0) ruby

  Current Bundler version:
    bundler (1.8.2)

This Gemfile requires a different version of Bundler.
Perhaps you need to update Bundler by running `gem install bundler`?

But I've come across this issue earlier in the day and I know that I can bundle update and bundle install using this:

bundle _1.0.22_ install

to force it to use the version of bundler it requires (just specifying it in the Gemfile is not enough, as you can see in the above error...)

So I use that. But it no longer works and gives me this error instead:

/Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/bundler-1.0.22/lib/bundler/source.rb:253:in `fetch_all_remote_specs': undefined method `list' for #<Gem::SpecFetcher:0x007fe9eba00d98> (NoMethodError)
    from /Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/bundler-1.0.22/lib/bundler/source.rb:234:in `block in remote_specs'
    from /Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/bundler-1.0.22/lib/bundler/source.rb:231:in `each'
    from /Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/bundler-1.0.22/lib/bundler/source.rb:231:in `remote_specs'
    from /Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/bundler-1.0.22/lib/bundler/source.rb:165:in `fetch_specs'
    from /Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/bundler-1.0.22/lib/bundler/source.rb:70:in `specs'
    from /Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/bundler-1.0.22/lib/bundler/definition.rb:176:in `block (2 levels) in index'
    from /Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/bundler-1.0.22/lib/bundler/definition.rb:175:in `each'
    from /Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/bundler-1.0.22/lib/bundler/definition.rb:175:in `block in index'
    from /Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/bundler-1.0.22/lib/bundler/index.rb:7:in `build'
    from /Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/bundler-1.0.22/lib/bundler/definition.rb:174:in `index'
    from /Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/bundler-1.0.22/lib/bundler/definition.rb:168:in `resolve'
    from /Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/bundler-1.0.22/lib/bundler/definition.rb:107:in `specs'
    from /Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/bundler-1.0.22/lib/bundler/definition.rb:102:in `resolve_remotely!'
    from /Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/bundler-1.0.22/lib/bundler/installer.rb:43:in `run'
    from /Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/bundler-1.0.22/lib/bundler/installer.rb:8:in `install'
    from /Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/bundler-1.0.22/lib/bundler/cli.rb:219:in `install'
    from /Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/bundler-1.0.22/lib/bundler/vendor/thor/task.rb:22:in `run'
    from /Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/bundler-1.0.22/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task'
    from /Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/bundler-1.0.22/lib/bundler/vendor/thor.rb:263:in `dispatch'
    from /Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/bundler-1.0.22/lib/bundler/vendor/thor/base.rb:386:in `start'
    from /Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/gems/bundler-1.0.22/bin/bundle:13:in `<top (required)>'
    from /Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/bin/bundle:23:in `load'
    from /Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/bin/bundle:23:in `<main>'
    from /Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/bin/ruby_executable_hooks:15:in `eval'
    from /Users/camillavk/.rvm/gems/ruby-1.9.3-p551@rails3/bin/ruby_executable_hooks:15:in `<main>'

Every other question I have found on here that is related to this at all have an extra line in the error saying which gem is breaking it...I don't, so have NO IDEA how to start figuring this out.

Have I dug myself into such a deep hole that I can't get out again? Does anyone have any ideas or suggestions on how to even start fixing this? Rails 3 clearly wants Bundler 1.0.22 but every answer I look at tells me to upgrade Bundler!

Just in case anyone thinks they can figure it out, here is my gemfile:

source 'https://rubygems.org'

gem "rails", "3.0.0"

#need to replace old acts_as_commentable vendor plugin
gem 'acts_as_commentable', '3.0.1'
gem "airbrake"
#need to add authlogic gem
gem 'authlogic', '~> 2.1.6'
gem "aws-s3"
gem "bj"
gem "bundler", "~> 1.0.0"
gem "calendar_date_select", "1.15"
gem "cancan", "1.2.0"
gem "carmen"
#replace plugin casein?
gem 'casein', '3.1.0'
gem 'comma', '0.4.1'
gem 'exifr'
# factory_girl 1.2.4 wasn't working with Rails 3 - consider an upgrade to factory_girl_rails?
# gem "factory_girl", "1.2.4"
gem 'fastercsv'
gem "geokit"
#need to replace above with below
gem 'geokit-rails'
gem "haml"
gem "hpricot"
gem 'hoptoad_notifier'
gem "jrails"
gem "libxml-ruby", "2.4.0"
gem "memcached", "~> 1.8.0"
#memcached no longer works?
gem 'dalli'
# Not sure why we have this if we're using SQLite3
gem "mysql2", "~> 0.2.6"
#TODO: changed by almazom
#adding gem rack to force update? - cvk
gem 'rack', '1.6.0'
gem "rake", "0.8.4"
gem 'recurly'
gem "rdoc"
gem "rmagick"
gem "rspreedly"
gem "rubyzip"
gem 'sass'
# searchlogic not supported for rails3
# gem 'searchlogic'
gem 'rd_searchlogic', :require => 'searchlogic'
#need to use simplecov when upgrading to ruby 2 as rcov doesn't work
gem "simplecov"
gem 'sqlite3'
# tmail no longer included in rails 3?
gem 'tmail'
#need to upgrade will_paginate for casein...?
# gem "will_paginate", "2.3.16"
gem 'will_paginate', '3.0.4'
gem 'yaml_db'

group :development, :test do
  gem 'test-unit', '1.2.3'
  gem 'rspec', '1.3.2'
  gem 'rspec-rails', '~> 1.3.4'
end

group :test do
  gem 'capybara', '0.3.5'
  gem 'cucumber', '1.1.2'
  gem 'cucumber-rails', :require => false
  gem 'database_cleaner'
end

Thanks in advance!


Solution

  • You could try to update Rails to 3.0.3 and run bundle install again.

    There aren't many differences between 3.0.0 and and 3.0.3, but 3.0.3 has a more relaxed dependency on bundler ~> 1.0 (see: RubyGems.org).

    Furthermore, I would suggest removing bundler from your Gemfile because it is a dependency of Rails anyway.