1

I searched the SO, there are several related question, but can not solve my issue.

When I run: $ bundle update

Fetching gem metadata from https://gems.ruby-china.org/..........
Fetching version metadata from https://gems.ruby-china.org/..
Resolving dependencies...
Bundler could not find compatible versions for gem "railties":
In Gemfile:
devise (~> 3.5.0) was resolved to 3.5.1, which depends on
railties (< 5, >= 3.2.6)
rails (~> 5.0.1) was resolved to 5.0.1, which depends on
railties (= 5.0.1)

The picture is below:

enter image description here

And, I run $ rails -v:

Could not find gem 'devise (~> 3.5.0)' in any of the gem sources listed in your Gemfile or available on this machine.

aircraft
  • 25,146
  • 28
  • 91
  • 166
  • Check your Gemfile and make sure it says `gem 'devise'` and not `gem 'devise', '~> 3.5.0'`. – jvillian Jan 26 '17 at 15:42
  • @jvillia, I'd recommend always controlling the version of gems, to prevent uncontrolled updates, at least to not jump to a new major version. – niels Jan 26 '17 at 16:04
  • Fair enough. It's not a practice I regularly follow - except of course when building gems (and I've been lucky so far, I guess). But, it's a good recommendation. Thanks. – jvillian Jan 26 '17 at 16:07

1 Answers1

3

You have fixed your version of devise to be a '3.5.x' version, which is incompatible with rails 5. In your Gemfile you will need to change the version of devise that you use, probably to a 4.x version, as 3.5, like this:

gem 'devise', '~> 3.5.0'

should become

gem 'devise', '~> 4.1.0'

or something like that.

niels
  • 1,719
  • 10
  • 20