代码之家  ›  专栏  ›  技术社区  ›  Chloe

如何在项目中更新Rails的版本?捆绑程序找不到gem“activemodel”的兼容版本

  •  0
  • Chloe  · 技术社区  · 7 年前

    activemodel >=4.2.0,>=4.0,且=5.2.1.rc1。那么为什么它不选择5.2.1.rc1,因为它满足所有依赖关系?

    宝石有几十个这样的错误 rails , railties

    我正在从Rails 4.2升级到最新的Rails。我注释掉了除了Ruby和Rails之外的所有版本说明符。这是我的全部 Gemfile

    workspace\>bundle
    Fetching gem metadata from https://rubygems.org/..............
    Fetching gem metadata from https://rubygems.org/..
    You have requested:
      rails ~> 5.2
    
    The bundle currently has rails locked at 4.2.3.
    Try running `bundle update rails`
    
    If you are updating multiple gems in your Gemfile at once,
    try passing them all to `bundle update`
    
    C:\Users\Chloe\workspace\>bundle update rails
    Fetching gem metadata from https://rubygems.org/..............
    Fetching gem metadata from https://rubygems.org/..
    Resolving dependencies........
    Bundler could not find compatible versions for gem "activemodel":
      In Gemfile:
        paperclip (~> 5.0) x64-mingw32 was resolved to 5.0.0, which depends on
          activemodel (>= 4.2.0) x64-mingw32
    
        rails (~> 5.2) x64-mingw32 was resolved to 5.2.1.rc1, which depends on
          activemodel (= 5.2.1.rc1) x64-mingw32
    
        web-console (~> 2.0) x64-mingw32 was resolved to 2.3.0, which depends on
          activemodel (>= 4.0) x64-mingw32
    
    1 回复  |  直到 7 年前
        1
  •  1
  •   David S.    7 年前

    首先备份您的 Gemfile.lock ,然后将其卸下并尝试执行以下操作 bundle install 再一次。