简体   繁体   中英

Bundler could not find compatible versions for gem “bundler”

Trying to install a new gem into a rails app and regardless of whether I add or remove a gem from the Gemfile, when I run bundle install , I get the following 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.3.5)

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

I am confused, because ~> 1.0.0 means that I have to have a version of bundler equal to or greater than 1.0.0 but less than 2.xx I'm fulfilling this requirement, so why is it failing?

Just to add, if I leave the Gemfile as is, bundle install works just fine.

UPDATE

Clearly, I misunderstood the ~> symbol. You can look at the checked answer below for an explanation, or an even more in depth one at Meaning of tilde-greater-than (~>) in version requirement?

Actually ~> 1.0.0 is equal to >= 1.0.0 && < 1.1 , so 1.3.5 doesn't match. You need another bundler version.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM