使用Cramp进行捆绑安装时出现奇怪的错误

时间:2014-04-23 13:41:41

标签: ruby-on-rails dependencies gemfile cramp

这是默认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上完成所有这些工作 以及具有相同Ruby和Rails版本的Ubuntu 12.04 LTS。

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

1 个答案:

答案 0 :(得分:2)

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

以下是Cramp Gem的其他选择

Alternatives for Cramp Gem