Rails捆绑安装尝试升级rake?

时间:2014-03-26 20:35:43

标签: ruby-on-rails ruby-on-rails-3.2 bundler ruby-1.8.7

在使用Ruby 1.8.7和Rails 3.2.13对“新”部署(例如,尚未使用Gemfile.lock)运行bundle install时,bundler似乎正在尝试升级到Rails 4!我不确定为什么这样做,因为我在我的Gemfile中将rails版本专门设置为3.2.13。

的Gemfile:

source "https://rubygems.org"

gem "rails", "3.2.13"
gem "mysql2", "= 0.3.13"
gem "json", "~> 1.8.0"

group :assets do
  #gem "guard-rails-assets", "~> 0.1.3"
  gem "sass-rails", "~> 3.2.6"
  gem "coffee-rails", "~> 3.2.2"
  gem "uglifier", "~> 1.0.3"
end

gem "jquery-rails", "~> 3.0.4"
gem "simple_form", "~> 2.1.0"
gem "bootstrap-sass", :path => "gems/bootstrap-sass-c0e12a90ba3e"#:github => "thomas-mcdonald/bootstrap-sass", :ref => "c0e12a90ba3e"
gem "bootstrap-datepicker-rails", "~> 1.3.0"
gem "client_side_validations", "~> 3.2.6"
gem "client_side_validations-simple_form", "~> 2.1.0"
gem "therubyracer", :platform => :ruby
gem "require_relative", "~> 1.0.3"
gem "icalendar", "= 1.4.3"
gem "whenever", "~> 0.8.4", :require => false
gem "jquery-cookie-rails", "~> 1.3.1"
gem "hominid", "~> 3.0.5"
gem "encryptor", "~> 1.3.0"
gem "kaminari", "~> 0.15.1"
gem "humanize_boolean", "~> 0.0.1"
gem "nilify_blanks", "~> 1.0.3"
gem "liquid", "~> 2.6.1"
gem "uuidtools"
gem "ckeditor", "4.0.4"
gem "paperclip", "~> 2.0"

bundle install的详细输出,为简洁而剪裁:

Resolving dependencies...

Gem::InstallError: rake requires Ruby version >= 1.9.
/usr/local/rvm/rubies/ruby-1.8.7-p374/lib/ruby/site_ruby/1.8/rubygems/installer.rb:518:in `ensure_required_ruby_version_met'
/usr/local/rvm/rubies/ruby-1.8.7-p374/lib/ruby/site_ruby/1.8/rubygems/installer.rb:774:in `pre_install_checks'
/usr/local/rvm/rubies/ruby-1.8.7-p374/lib/ruby/site_ruby/1.8/rubygems/installer.rb:216:in `install'
/usr/local/rvm/gems/ruby-1.8.7-p374@global/gems/bundler-1.5.3/lib/bundler/source/rubygems.rb:94:in `install'
/usr/local/rvm/gems/ruby-1.8.7-p374@global/gems/bundler-1.5.3/lib/bundler/rubygems_integration.rb:118:in `preserve_paths'
/usr/local/rvm/gems/ruby-1.8.7-p374@global/gems/bundler-1.5.3/lib/bundler/source/rubygems.rb:93:in `install'
/usr/local/rvm/gems/ruby-1.8.7-p374@global/gems/bundler-1.5.3/lib/bundler/installer.rb:111:in `install_gem_from_spec'
/usr/local/rvm/gems/ruby-1.8.7-p374@global/gems/bundler-1.5.3/lib/bundler/rubygems_integration.rb:150:in `with_build_args'
/usr/local/rvm/gems/ruby-1.8.7-p374@global/gems/bundler-1.5.3/lib/bundler/installer.rb:110:in `install_gem_from_spec'
/usr/local/rvm/gems/ruby-1.8.7-p374@global/gems/bundler-1.5.3/lib/bundler/installer.rb:265:in `install_sequentially'
(__FORWARDABLE__):3:in `each'
(__FORWARDABLE__):3:in `__send__'
(__FORWARDABLE__):3:in `each'
/usr/local/rvm/gems/ruby-1.8.7-p374@global/gems/bundler-1.5.3/lib/bundler/installer.rb:264:in `install_sequentially'
/usr/local/rvm/gems/ruby-1.8.7-p374@global/gems/bundler-1.5.3/lib/bundler/installer.rb:97:in `run'
/usr/local/rvm/gems/ruby-1.8.7-p374@global/gems/bundler-1.5.3/lib/bundler/installer.rb:15:in `install'
/usr/local/rvm/gems/ruby-1.8.7-p374@global/gems/bundler-1.5.3/lib/bundler/cli.rb:255:in `install'
/usr/local/rvm/gems/ruby-1.8.7-p374@global/gems/bundler-1.5.3/lib/bundler/vendor/thor/command.rb:27:in `__send__'
/usr/local/rvm/gems/ruby-1.8.7-p374@global/gems/bundler-1.5.3/lib/bundler/vendor/thor/command.rb:27:in `run'
/usr/local/rvm/gems/ruby-1.8.7-p374@global/gems/bundler-1.5.3/lib/bundler/vendor/thor/invocation.rb:121:in `invoke_command'
/usr/local/rvm/gems/ruby-1.8.7-p374@global/gems/bundler-1.5.3/lib/bundler/vendor/thor.rb:363:in `dispatch'
/usr/local/rvm/gems/ruby-1.8.7-p374@global/gems/bundler-1.5.3/lib/bundler/vendor/thor/base.rb:440:in `start'
/usr/local/rvm/gems/ruby-1.8.7-p374@global/gems/bundler-1.5.3/lib/bundler/cli.rb:10:in `start'
/usr/local/rvm/gems/ruby-1.8.7-p374@global/gems/bundler-1.5.3/bin/bundle:20
/usr/local/rvm/gems/ruby-1.8.7-p374@global/gems/bundler-1.5.3/lib/bundler/friendly_errors.rb:5:in `with_friendly_errors'
/usr/local/rvm/gems/ruby-1.8.7-p374@global/gems/bundler-1.5.3/bin/bundle:20
/usr/local/rvm/gems/ruby-1.8.7-p374@global/bin/bundle:23:in `load'
/usr/local/rvm/gems/ruby-1.8.7-p374@global/bin/bundle:23
/usr/local/rvm/gems/ruby-1.8.7-p374/bin/ruby_executable_hooks:15
An error occurred while installing rake (10.2.1), and Bundler cannot continue.
Make sure that `gem install rake -v '10.2.1'` succeeds before bundling.

为什么bundler会首先尝试安装Rake v10.2.1?

2 个答案:

答案 0 :(得分:2)

Rake正在安装,因为Rails需要它。 Bundler尝试安装最新版本的Rake,即10.2.1。但是,Rake不再支持Ruby 1.8(从10.2.0版开始)

在你的Gemfile中锁定Rake到10.1.1(或切换到Ruby> = 1.9),你应该没问题:

gem 'rake', '~> 10.1.1'

答案 1 :(得分:0)

我认为你应该将你的ruby版本设置在gemfile的顶部

ruby '1.8.7'

或者使用rvm和gemsets