【问题标题】:Capistrano: Could not find rake-$WRONG_VERSION in any of the sourcesCapistrano:在任何来源中都找不到 rake-$WRONG_VERSION
【发布时间】:2017-01-13 01:14:58
【问题描述】:

我们在我们的服务器上使用 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 上有rake!当我 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 呢?我真的不知道发生了什么。该死的吉姆,我是软件开发人员,而不是系统管理员!

编辑:我放弃了,实际上将 rake 版本 11.1.2 写入了 Gemfile。现在我收到了同样的信息,但需要主动支持:

Could not find activesupport-4.2.6 in any of the sources

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

【问题讨论】:

  • 您用于bundle install 的Ruby 版本和/或rvm gemset 是否可能与您运行bundle exec 时不同?也许bundle exec ruby -vbundle exec gem list 会提供一些线索。
  • 不过,日志输出包含正确的 Ruby 版本作为命令路径的一部分。

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


【解决方案1】:

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-03-12
    • 1970-01-01
    • 2013-12-25
    • 2017-07-18
    • 2012-07-22
    • 2011-11-28
    相关资源
    最近更新 更多