Capistrano:在任何来源中都找不到rake- $ WRONG_VERSION

时间:2016-09-05 16:21:34

标签: ruby-on-rails ruby deployment rake capistrano

我们在服务器上使用rvm,我刚刚升级到Ruby 2.3.1。现在,当我尝试将项目部署到登台服务器时,我收到以下错误消息:

** DEPLOY FAILED
** Refer to log/capistrano.log for details. Here are the last 20 lines:

 DEBUG [49e3047b] Finished in 0.269 seconds with exit status 0 (successful).
  INFO [96bd9c75] Running ~/.rvm/bin/rvm default do bundle exec rake gettext:pack as deployer@nginx-stage.webit.local
 DEBUG [96bd9c75] Command: cd /home/deployer/PROJECTNAME/current && ( export RAILS_ENV="production" ; ~/.rvm/bin/rvm default do bundle exec rake gettext:pack )
 DEBUG [96bd9c75]       /home/deployer/.rvm/gems/ruby-2.3.1@global/gems/bundler-1.12.5/lib/bundler/spec_set.rb:95:in `block in materialize'
 DEBUG [96bd9c75]       :
 DEBUG [96bd9c75]       Could not find rake-11.1.2 in any of the sources
 DEBUG [96bd9c75]        (
 DEBUG [96bd9c75]       Bundler::GemNotFound
 DEBUG [96bd9c75]       )
 DEBUG [96bd9c75]               from /home/deployer/.rvm/gems/ruby-2.3.1@global/gems/bundler-1.12.5/lib/bundler/spec_set.rb:88:in `map!'
 DEBUG [96bd9c75]               from /home/deployer/.rvm/gems/ruby-2.3.1@global/gems/bundler-1.12.5/lib/bundler/spec_set.rb:88:in `materialize'
 DEBUG [96bd9c75]               from /home/deployer/.rvm/gems/ruby-2.3.1@global/gems/bundler-1.12.5/lib/bundler/definition.rb:140:in `specs'
 DEBUG [96bd9c75]               from /home/deployer/.rvm/gems/ruby-2.3.1@global/gems/bundler-1.12.5/lib/bundler/definition.rb:185:in `specs_for'
 DEBUG [96bd9c75]               from /home/deployer/.rvm/gems/ruby-2.3.1@global/gems/bundler-1.12.5/lib/bundler/definition.rb:174:in `requested_specs'
 DEBUG [96bd9c75]               from /home/deployer/.rvm/gems/ruby-2.3.1@global/gems/bundler-1.12.5/lib/bundler/environment.rb:19:in `requested_specs'
 DEBUG [96bd9c75]               from /home/deployer/.rvm/gems/ruby-2.3.1@global/gems/bundler-1.12.5/lib/bundler/runtime.rb:14:in `setup'
 DEBUG [96bd9c75]               from /home/deployer/.rvm/gems/ruby-2.3.1@global/gems/bundler-1.12.5/lib/bundler.rb:95:in `setup'
 DEBUG [96bd9c75]               from /home/deployer/.rvm/gems/ruby-2.3.1@global/gems/bundler-1.12.5/lib/bundler/setup.rb:19:in `<top (required)>'
 DEBUG [96bd9c75]               from /home/deployer/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
 DEBUG [96bd9c75]               from /home/deployer/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'

这很奇怪,因为Gemfile.lock在版本11.2.2上有耙子!当我ssh到登台服务器并执行手册bundle install时,一切正常。这是登台服务器上的.bundle/config文件:

---
BUNDLE_FROZEN: '1'
BUNDLE_PATH: "/home/deployer/PROJECTNAME/shared/bundle"
BUNDLE_WITHOUT: development:test
BUNDLE_DISABLE_SHARED_GEMS: true

我更新了capistrano,bundler,passenger和nginx,但我无法让它工作。我还删除了/home/deployer/PROJECTNAME/shared/bundle而没有任何更改。奇怪的是,在运行另一个部署后,它创建了/home/deployer/PROJECTNAME/shared/bundle/ruby/2.3.0/bundler。查看2.3.0?但我安装的Ruby版本是2.3.1

为什么它会寻找错误版本的rake呢?我真的不知道发生了什么事。该死的Jim,我是一名软件开发人员,而不是系统管理员!

编辑:我放弃并实际将rake版本11.1.2写入Gemfile。现在我收到相同的消息,但是对于activesupport:

Could not find activesupport-4.2.6 in any of the sources

WTF正在进行中?为什么所有这些旧版本?我不想要他们!

1 个答案:

答案 0 :(得分:0)

我想我通过更新react_on_rails gem来解决这个问题。但这是货运崇拜计算。我从来没有发现为什么它表现那样,我只是尝试了一些东西。我还删除了tmp/cache