如何解决此铁路兼容性问题?

时间:2012-02-26 16:34:12

标签: ruby-on-rails

当我运行bundle update时,我收到了这个错误:

  

捆绑更新

     

获取https://rubygems.org/

的源索引      

Bundler找不到gem“railties”的兼容版本:      在Gemfile中:       rails(= 3.2.1)x86-mingw32取决于         railties(= 3.2.1)x86-mingw32

sass-rails (= 3.2.3) x86-mingw32 depends on
  railties (3.2.2.rc1)

我是Rails的新手,并且一般都是stackoverflow,对于任何布局不便,我深表歉意。任何帮助将不胜感激。谢谢

编辑1:这是我的gemfile

source 'https://rubygems.org'

gem 'rails', '3.2.1'

# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'

group :development, :test do
  gem 'sqlite3', '1.3.5'
  gem 'rspec-rails', '2.8.1'
end

# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem 'sass-rails',   '3.2.3'
  gem 'coffee-rails', '3.2.2'
  gem 'uglifier', '1.2.3'
end

gem 'jquery-rails', '2.0.0'

group :test do
  gem 'capybara', '1.1.2'
end

group :production do
  gem 'pg', '0.12.2'
end

# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'

# To use Jbuilder templates for JSON
# gem 'jbuilder'

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

# Deploy with Capistrano
# gem 'capistrano'

# To use debugger
# gem 'ruby-debug19', :require => 'ruby-debug'

5 个答案:

答案 0 :(得分:3)

您需要更改Gemfile中的资产组以删除显式版本:

group :assets do
  gem 'sass-rails'
  gem 'coffee-rails'
  gem 'uglifier'
end

然后更新sass-rails:

bundle update sass-rails

答案 1 :(得分:1)

我有点类似的错误......   在Gemfile中:     rails(= 3.2.1)x86-mingw32取决于       railties(= 3.2.1)x86-mingw32

jquery-rails (= 2.0.0) x86-mingw32 depends on
  railties (3.2.2.rc1)

删除Gemfile.lock后再次尝试捆绑安装

答案 2 :(得分:1)

运行     捆绑更新rails 为我解决了这个问题。

答案 3 :(得分:0)

jquery-rails依赖项指定railties> = 3.2.0.beta,它与上周的3.2.2 beta匹配,同时rails仍然需要3.2.1。

相关:https://github.com/rails/jquery-rails/pull/48

答案 4 :(得分:0)

更新到Rails 4.1.3时遇到了类似的问题。运行捆绑包更新不是一个好习惯,因为它更新了所有宝石,而在大型应用程序上,很难修复您将要拥有的所有错误。 相反,我同时更新了必要的宝石:

bundle update rails sass-rails