45

我正在尝试升级到 Rails 4.0.0,并更改了sass-railscoffee-rails. 在升级到 Rails 4 之前,rails我需要解决这个 gem 冲突。coffee-rails

当我运行bundle update这是我得到的输出:

$ bundle update
Updating git://github.com/pilu/web-app-theme.git
Fetching source index from https://rubygems.org/
Resolving dependencies..............
Bundler could not find compatible versions for gem "railties":
  In Gemfile:
    rails (= 4.0.0) ruby depends on
      railties (= 4.0.0) ruby

    coffee-rails (= 4.0.0) ruby depends on
      railties (4.0.0.rc2)

我的Gemfile

source 'https://rubygems.org'

gem 'rails', '4.0.0'

gem 'cancan'
gem 'client_side_validations'
gem 'devise', '~> 1.5.3'
gem 'dynamic_form'
gem 'execjs'
gem 'haml'
gem 'httparty'
gem 'jquery-rails'
gem 'mysql2'
gem 'paperclip', '~> 2.4'
gem 'prawn'
gem 'rails3-jquery-autocomplete'
gem 'rake', '0.9.2'
gem 'remotipart', '~> 1.0'
gem 'simple_datatables'
gem 'therubyracer'
gem 'validates_timeliness', '~> 3.0.2'
gem 'will_paginate', '~> 3.0'

gem 'turbolinks'
gem 'jquery-turbolinks'

gem 'noty-rails'

gem 'font-awesome-rails'

gem 'socket.io-rails'

gem 'attr_encrypted'

gem 'bullet', :group => 'development'

#temp for demo.managetherapy.com
#gem 'faker'

group :test do
  gem 'capybara'
  gem 'cucumber-rails', :require => false
  gem 'database_cleaner'
  gem 'factory_girl_rails'
#  gem 'faker'
  gem 'guard-rspec'
  gem 'selenium-webdriver', '2.7.0'
  gem 'webrat'
end

group :development, :test do
  gem 'faker'
  gem 'haml-rails'
  gem 'hpricot'
  gem 'rspec-rails'
  gem 'ruby_parser'
  #gem 'web-app-theme', '~> 0.8.0'
  gem 'web-app-theme', :git =>'git://github.com/pilu/web-app-theme.git'
end

gem 'sass-rails', '4.0.0'
gem 'compass-rails', '1.0.3'
gem 'coffee-rails', '4.0.0'
gem 'uglifier', '>= 2.1.1'
gem 'bootstrap-sass-rails'

# Use unicorn as the web server
#gem 'unicorn'

# Deploy with Capistrano
gem 'capistrano'
gem 'rvm-capistrano'

gem 'passenger'
4

6 回答 6

73

还只允许您一次更新一个 gem,如果您要更新并且必须同时更新大量 gem bundle update,这很难。Rails 4

我通过删除Gemfile.lock和做解决了这个问题bundle install

这当然是假设您一开始就没有冲突的显式 gem 版本Gemfile。因此,如果这失败了,请从 Gemfile 中删除版本号。

于 2013-07-21T09:08:51.163 回答
27

只需从 Gemfile 中删除 gem 版本(coffee-rails 和 sass-rails)并运行bundle update

于 2013-08-29T11:36:49.507 回答
12

gem update rails先跑再跑bundle update

于 2013-06-26T20:03:35.750 回答
9

你有一个过时的 Devise 版本,使用兼容 Rails 4

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

coffee-rails改成

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

并尝试做

bundle update coffee-rails
于 2013-07-21T07:59:16.897 回答
7

您有 Rails 4 不支持的 gem。注释掉除 Rails 4 之外的所有 gem,并在运行 bundle install 后一次取消注释以找出罪魁祸首。您可能需要撤消某些版本锁定。

于 2013-07-20T22:49:41.060 回答
2
  1. 删除Gemfile.lock文件
  2. 请参阅此处了解基本的 gemfile 更改
  3. bundle install

一切都会好起来的。:)

于 2014-02-28T05:36:48.453 回答