2

The same question was asked here, though there wasn't an answer that worked in my case.

I am completely new to Ruby/Rails/RVM/Bundler/Gemfile/etc. and I am following Hertl's Rails 3 Tutorial. I am having the same problem as stated in the link above: Bundler could not find compatible versions for gem bundler.

When I run "$ bundle install" I get the following message:

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

Current Bundler version:
bundler (1.2.1)

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

I have no idea where to go from here. I have tried Hertl's suggestion of specifying a specific Bundler version -- he suggests trying 1.2.5 or 1.3.1, whichever works -- but I get the same error even when specifying a specific version of Bundler.

I really have no idea where to go from here, and am frustrated by the lack of clarity. A simple diagram would help me understand the relationship between these disparate utilities; otherwise I'm just shooting in the dark. An answer that helps relate the different components necessary to get Rails operative would be great!

Does anybody have good advice?

Community
  • 1
  • 1
continuist
  • 23
  • 4

1 Answers1

2

The key is the dependency that Rails 3.0.1 has on Bundler (~> 1.0.0). This notation means that you are able to use versions of bundler from 1.0.0 but less than 1.1.0 - as you are trying to use 1.2.1 you are getting an error.

The easiest resolution to this is to uninstall bundler 1.2.1 and install bundler 1.0.22 which is the last version compatible with the version of Rails that you are using.

gem uninstall bundler
gem install bundler -v1.0.22

This will fix your issue but if you are following Hartl's tutorial you may run into other issues as, at the time of this question, the tutorial uses Rails v3.2.8. Is there any reason that you are using 3.0.1 rather than 3.2.8? My suggestion is to use the version that the tutorial uses otherwise you may run into difficult to diagnose errors.

If you can go to Rails 3.2.8 then your problem will also be resolved as bundler 1.2.1 is compatible with Rails 3.2.8.

nmott
  • 9,454
  • 3
  • 45
  • 34
  • I ran into the same issues just now. I think we both have the print copy of the tutorial, and it makes use of Rails 3.0.1. – bilalq Oct 06 '12 at 04:53