Rails 3.1.2 - Bundler 找不到 gem “railties” 的兼容版本
我正在尝试安装新版本的 twitter-bootstrap-rails
gem (v2),但出现上述错误。这是我的 Gemfile 的样子:
source 'http://rubygems.org'
gem 'rails', '3.1.2'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'mysql2'
gem 'authlogic'
gem "paperclip", "~> 2.4.5"
gem 'aws-s3'
gem 'actionmailer'
gem "twitter-bootstrap-rails", "~> 2.0"
gem 'sunspot_rails'
#endless page
gem 'will_paginate'
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.1.5.rc.2'
gem 'coffee-rails', '~> 3.1.1'
gem 'uglifier', '>= 1.0.3'
end
group :production do
gem 'therubyracer-heroku', '~> 0.8.1.pre3'
gem 'pg'
gem 'thin'
end
group :development do
gem "taps", "~> 0.3.23"
gem "rvm", "~> 1.9.2"
end
gem 'jquery-rails'
# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'
# Use unicorn as the web server
# gem 'unicorn'
# Deploy with Capistrano
# gem 'capistrano'
# To use debugger
# gem 'ruby-debug19', :require => 'ruby-debug'
完整的错误:
Bundler could not find compatible versions for gem "railties":
In Gemfile:
twitter-bootstrap-rails (~> 2.0) ruby depends on
railties (>= 3.2.1) ruby
sass-rails (~> 3.1.5.rc.2) ruby depends on
railties (3.1.0)
出了什么问题?当我删除版本 ~>; 2.0
来自 gem,它可以工作,但我需要新版本的 bootstrap...
编辑: 捆绑安装
Bundler could not find compatible versions for gem "railties":
In snapshot (Gemfile.lock):
railties (3.1.2)
In Gemfile:
twitter-bootstrap-rails (~> 2.0) ruby depends on
railties (>= 3.2.1) ruby
Running `bundle update` will rebuild your snapshot from scratch, using only
the gems in your Gemfile, which may resolve the conflict.
I am trying to install the new version of the twitter-bootstrap-rails
gem (v2), but getting the error above. This is how my Gemfile looks:
source 'http://rubygems.org'
gem 'rails', '3.1.2'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'mysql2'
gem 'authlogic'
gem "paperclip", "~> 2.4.5"
gem 'aws-s3'
gem 'actionmailer'
gem "twitter-bootstrap-rails", "~> 2.0"
gem 'sunspot_rails'
#endless page
gem 'will_paginate'
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.1.5.rc.2'
gem 'coffee-rails', '~> 3.1.1'
gem 'uglifier', '>= 1.0.3'
end
group :production do
gem 'therubyracer-heroku', '~> 0.8.1.pre3'
gem 'pg'
gem 'thin'
end
group :development do
gem "taps", "~> 0.3.23"
gem "rvm", "~> 1.9.2"
end
gem 'jquery-rails'
# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'
# Use unicorn as the web server
# gem 'unicorn'
# Deploy with Capistrano
# gem 'capistrano'
# To use debugger
# gem 'ruby-debug19', :require => 'ruby-debug'
And complete error:
Bundler could not find compatible versions for gem "railties":
In Gemfile:
twitter-bootstrap-rails (~> 2.0) ruby depends on
railties (>= 3.2.1) ruby
sass-rails (~> 3.1.5.rc.2) ruby depends on
railties (3.1.0)
What is wrong? When I remove the version ~> 2.0
from the gem, it works, but I need the new version of bootstrap...
EDIT: bundle install
Bundler could not find compatible versions for gem "railties":
In snapshot (Gemfile.lock):
railties (3.1.2)
In Gemfile:
twitter-bootstrap-rails (~> 2.0) ruby depends on
railties (>= 3.2.1) ruby
Running `bundle update` will rebuild your snapshot from scratch, using only
the gems in your Gemfile, which may resolve the conflict.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
解决方案:
然后
Solution:
And then
答案就在 Bundler 的输出中。您的项目正在使用 Rails 3.1.2,这需要 Railties 3.1.2。您尝试安装的 twitter-bootstrap-rails 版本显然取决于railties >= 3.2.1,而您没有。
从外观上看,您有三个选择:
The answer is in Bundler's output. Your project is using Rails 3.1.2, which requires railties 3.1.2. The version of twitter-bootstrap-rails you are trying to install apparently depends on railties >= 3.2.1, which you don't have.
You have three options, from the looks of it: