joker1007 / activemodel-associations

has_many and belongs_to macro for Plain Ruby Object.
MIT License
79 stars 27 forks source link

Bundler could not find compatible versions for gem "bundler" #15

Open syedrakib opened 5 years ago

syedrakib commented 5 years ago

I have been running a Rails 4 app and my GemFIle has been fine and installing all gems perfectly all this time with Bundler 2.0.1.

Today, when i added gem "activemodel-associations" into the Gemfile, and then tried to install with bundle install, i have been getting this error:

> bundle install
Fetching gem metadata from https://rubygems.org/.......
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies.............
Bundler could not find compatible versions for gem "bundler":
  In Gemfile:
    rails (= 4.2.11) was resolved to 4.2.11, which depends on
      bundler (< 2.0, >= 1.3.0)

    sassc-rails was resolved to 1.3.0, which depends on
      sassc (~> 1.9) was resolved to 1.10.0, which depends on
        bundler

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

Could not find gem 'bundler (< 2.0, >= 1.3.0)', which is required by gem 'rails (= 4.2.11)', in any of the sources.

Upon removing the gem "activemodel-associations" line from my Gemfile and then running bundle install works fine again.

joker1007 commented 5 years ago

I think that activemodel-association does not cause the probrem.

Because bundler-2.0 conflicts with rails-4.x, bundler-2.0 cannot install rails-4.x. If you updated bundler after starting to develop the rails project, Other gems also cause same probrem probably. I guess so. can you do bundle update in the project?