【问题标题】:How to solve 'Bundler could not find compatible versions for gem "jquery-rails"'如何解决'Bundler 找不到 gem "jquery-rails" 的兼容版本'
【发布时间】:2014-06-23 02:53:51
【问题描述】:

知道为什么会出现此错误:gem 的兼容版本。

  @ -SVE1411EGXB:~/refine/active/myapp$ bundle install
    Fetching gem metadata from https://rubygems.org/........
    Fetching additional metadata from https://rubygems.org/..
    Resolving dependencies...
    Bundler could not find compatible versions for gem "jquery-rails":
      In snapshot (Gemfile.lock):
    jquery-rails (3.1.0)

  In Gemfile:
    refinerycms-core (~> 2.1.2) ruby depends on
      jquery-rails (~> 2.3.0) ruby

Running `bundle update` will rebuild your snapshot from scratch, using only
the gems in your Gemfile, which may resolve the conflict.
 @ -SVE1411EGXB:~/refine/active/myapp$ ls
app  config  config.ru  db  doc  Gemfile  Gemfile.lock  lib  log  public  Rakefile  README.rdoc  script  test  tmp  vendor
 @ -SVE1411EGXB:~/refine/active/myapp$ rm Gemfile.lock 
 @ -SVE1411EGXB:~/refine/active/myapp$ bundle install
Fetching gem metadata from https://rubygems.org/........
Fetching additional metadata from https://rubygems.org/..
Resolving dependencies...
Using rake 10.3.2
Using i18n 0.6.9
Using multi_json 1.10.1
~
~
~
~
~
~

Using refinerycms-resources 2.1.2
Using refinerycms 2.1.2
Installing refinerycms-acts-as-indexed 1.0.0
Using sqlite3 1.3.9
Using uglifier 2.5.1
Your bundle is complete!
Use `bundle show [gemname]` to see where a bundled gem is installed.
 @ -SVE1411EGXB:~/refine/active/myapp$ rails server
=> Booting WEBrick
=> Rails 3.2.18 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
[2014-06-22 22:41:21] INFO  WEBrick 1.3.1
[2014-06-22 22:41:21] INFO  ruby 2.1.2 (2014-05-08) [x86_64-linux]
[2014-06-22 22:41:21] INFO  WEBrick::HTTPServer#start: pid=4941 port=3000

【问题讨论】:

    标签: ruby ruby-on-rails-3 refinerycms


    【解决方案1】:

    问题在于您的refinerycms-core gem 依赖于旧版本的jquery-rails(特别是版本2.3.0)。

    由于您尝试安装更新版本的 jquery-rails (3.1.0),bundler 警告您安装最新版本可能会破坏兼容性。

    当您删除您的Gemfile.lock 时,您删除了您拥有的每个宝石的所有“锁定”版本,因此从头开始。您现在将拥有更新版本的 refinerycms-core,它将与 jquery-rails 一起使用 3.1.0

    【讨论】:

    • 感谢@Martin Konecny。现在我知道为什么这样做了:)
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-08-14
    • 2011-10-31
    • 1970-01-01
    • 2013-06-30
    • 2019-03-28
    • 2023-03-14
    相关资源
    最近更新 更多