Search code examples
ruby-on-railsbundler

bundle update rails resolving to 6.0.1 release candidate


I'm trying to update rails from 5.2 to 6.0. In my Gemfile I have declared:

rails (~> 6.0) was resolved to 6.0.1.rc1

My expectation there is that I'd end up with 6.0.4 the ~> meaning optimistically resolve to the latest 6.0.* version?) Resolving to a release candidate isn't something I want to do.

I can specify it directly, of course, but I'd rather not tie the Gemfile to a specific version and count on bundler to resolve it correctly.


Solution

  • One quick fix would be to alter your Gemfile. If you want to retain the optimistic ~> 6.0 operator, you can add a second matcher for the version, like this (and thus report an error if it can't do so):

    gem 'rails', '~> 6.0', '>= 6.0.4'
    

    I often use this pattern to lock in security patches without losing the flexibility of the ~> operator.

    I'd guess that something is preventing bundler from using a later Rails gem version - that is, you have a dependency that's locking your gem version to 6.0.1. If the above doesn't resolve it, can you post the relevant portions of your Gemfile in your question? And search Gemfile.lock for rails to see whether you have any gems that require rails 6.0.1 and not later versions.