user8116786
user8116786

Reputation:

How to fix 'could not find compatible version for gem "rails"'?

Im literaly bumping my head into a wall and I can not find a solution by myself about this problem.

I'm starting a project with Solidus , a Spree commerce fork. I played around with the gem for a litle while and now that I am ready to get serious and start to develop , I create a new project ad I'm bumping into this nasty error :

Bundler could not find compatible versions for gem "rails":
  In snapshot (Gemfile.lock):
    rails (= 5.1.2)

  In Gemfile:
    rails (~> 5.1.2)

    solidus was resolved to 1.0.0, which depends on
      solidus_core (= 1.0.0) was resolved to 1.0.0, which depends on
        rails (~> 4.2.0)

Running `bundle update` will rebuild your snapshot from scratch, using only
the gems in your Gemfile, which may resolve the conflict.

and bundle update is not solving my problem... I am running out of solution and will appreciate some hands in help in how to fix this problem.

Thanks

Upvotes: 4

Views: 5163

Answers (1)

Puhlze
Puhlze

Reputation: 2614

Bundler is doing you a favor here by showing you that you have incompatible version requirements for the rails gem.

You have rails (~> 5.1.2) listed in your gemfile and the solidus gem has a dependency on rails (~> 4.2.0), so there is a conflict about which version of rails your app should use.

Is there a reason you are using solidus version 1.0.0? It looks like the latest version of solidus is 2.0.2 at present. Later versions of solidus will have a more recent dependency listed for rails, which will allow your application to use rails 5+.

Update the version of solidus in your gemfile to something more recent and see if that allows bundler to install successfully.

Upvotes: 5

Related Questions