【问题标题】:Strange errors when doing bundle install with Cramp使用 Cramp 进行捆绑安装时出现奇怪的错误
【发布时间】:2014-06-08 09:34:39
【问题描述】:

这是默认 Rails 应用程序的Gemfile

source 'https://rubygems.org'
gem 'rails', '4.1.0'
gem 'sqlite3'
gem 'sass-rails', '~> 4.0.3'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 2.0'
gem 'sdoc', '~> 0.4.0',          group: :doc
gem 'tzinfo-data', platforms: [:mingw, :mswin]

当我运行 bundle install 时,一切都很好。

现在做

gem install cramp

安装中也没有任何问题。

最后包括

gem 'cramp'

进入Gemfile。从现在开始,我们有以下结果:

捆绑安装

DL is deprecated, please use Fiddle
Fetching gem metadata from https://rubygems.org/..........
Fetching additional metadata from https://rubygems.org/..
Resolving dependencies...
Bundler could not find compatible versions for gem "activesupport":
  In Gemfile:
    cramp (>= 0) x86-mingw32 depends on
      activesupport (= 3.0.pre) x86-mingw32

    rails (= 4.1.0) x86-mingw32 depends on
      railties (= 4.1.0) x86-mingw32 depends on
        activesupport (4.1.0)

捆绑更新

DL is deprecated, please use Fiddle
Fetching gem metadata from https://rubygems.org/..........
Fetching additional metadata from https://rubygems.org/..
Resolving dependencies...
Bundler could not find compatible versions for gem "thor":
  In Gemfile:
    cramp (>= 0) x86-mingw32 depends on
      thor (~> 0.14.6) x86-mingw32

    rails (= 4.1.0) x86-mingw32 depends on
      railties (= 4.1.0) x86-mingw32 depends on
        thor (0.19.1)

Bundler could not find compatible versions for gem "activesupport":
  In Gemfile:
    cramp (>= 0) x86-mingw32 depends on
      activesupport (= 3.0.pre) x86-mingw32

    rails (= 4.1.0) x86-mingw32 depends on
      activesupport (4.1.0)

我没有指定 Cramp 版本,所以必须使用与 gem install cramp 安装的相同版本。但是为什么gem install 工作没有任何问题,而 bundle install 发现了一些未解决的依赖关系?

我正在尝试在 Windows 7 + Ruby 2.0.0p451 + Rails 4.1.0 上完成这一切 在 Ubuntu 12.04 LTS 上使用相同的 Ruby 和 Rails 版本。

我尝试了什么:我在默认 Gemfile 上运行 bundle installbundle update,然后添加 gem 'cramp',再次运行 bundle installbundle update。结果你可以在上面看到几行。

【问题讨论】:

  • @SNEH PANDYA:在发帖之前已经这样做了,没有结果。
  • 重命名 Gemfile.lock 并再次进行捆绑安装..
  • @Sumit Munot:结果相同。
  • 似乎“Cramp” gem 可能不支持“Rails 4”..你能用 rails 3 试试吗...
  • 这里是 git repo 似乎只支持 Rails->3+ ..github.com/lifo/cramp

标签: ruby-on-rails dependencies gemfile cramp


【解决方案1】:

Cramp 似乎在过去 4 个月内处于非活动状态,it doesn't support Rails 4

这里有一些抽筋宝石的替代品

Alternatives for Cramp Gem

【讨论】:

    猜你喜欢
    • 2011-11-22
    • 2013-06-16
    • 1970-01-01
    • 2013-08-23
    • 1970-01-01
    • 2017-07-11
    • 2021-05-25
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多