Bundler could not find compatible versions for gem “railties” for Rails 4.0.0

后端 未结 6 1915
名媛妹妹
名媛妹妹 2020-12-29 01:37

I am trying to upgrade to Rails 4.0.0, and I changed the gem versions of sass-rails and coffee-rails. I need to resolve this gem conflict between <

相关标签:
6条回答
  • 2020-12-29 01:54

    Run gem update rails first, then bundle update

    0 讨论(0)
  • 2020-12-29 01:58

    Also bundle update only allows you to update one gem at a time, which is hard if you are updating to Rails 4 and a whole lot of gems have to be updated at the same time.

    I solved this by deleting the Gemfile.lock and doing bundle install.

    This is of course assuming you have no conflicting explicit gem version in your Gemfile to start with. So if this fails, remove version numbers from the Gemfile.

    0 讨论(0)
  • 2020-12-29 02:01

    You have an outdated version of Devise, use Rails 4 compatible

    gem 'devise', '~> 3.0.0.rc'
    

    Also change coffee-rails to

    gem 'coffee-rails', '~> 4.0.0'
    

    and try doing

    bundle update coffee-rails
    
    0 讨论(0)
  • 2020-12-29 02:05

    Just remove gem versions (coffee-rails and sass-rails) from Gemfile and run bundle update

    0 讨论(0)
  • 2020-12-29 02:07
    1. Delete the Gemfile.lock file
    2. refer here for basic gemfile changes
    3. run bundle install

    Everything will work fine. :)

    0 讨论(0)
  • 2020-12-29 02:09

    You have gems that aren't supported by Rails 4. Comment out all the gems except for Rails 4 and uncomment them one at a time after running bundle install to find the culprits. You might need to undo some of your version locks.

    0 讨论(0)
提交回复
热议问题