Capistrano部署时出现多个错误

时间:2018-06-29 21:46:25

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

嗨,所以我尝试使用Capistrano部署到服务器上,在我安装了rails bundler并已安装所有其他东西的服务器上,但这是Capistrano日志

https://gist.github.com/benbagley/cf8233aaa0c5adac0fa09f2194fc6890

这是错误的精简版本:

00:27 deploy:assets:precompile
      01 RBENV_ROOT=/home/poladmin/.rbenv RBENV_VERSION=2.5.1 /home/poladmin/.rbenv/bin/rbenv exec rake assets:precompile
      01 rake aborted!
      01 Bundler::GemNotFound: Could not find rake-12.3.1 in any of the sources
      01 /home/poladmin/poetry_out_loud_v2/releases/20180629214135/config/boot.rb:3:in `<top (required)>'
      01 /home/poladmin/poetry_out_loud_v2/releases/20180629214135/config/application.rb:1:in `require_relative'
      01 /home/poladmin/poetry_out_loud_v2/releases/20180629214135/config/application.rb:1:in `<top (required)>'
      01 /home/poladmin/poetry_out_loud_v2/releases/20180629214135/Rakefile:4:in `require_relative'
      01 /home/poladmin/poetry_out_loud_v2/releases/20180629214135/Rakefile:4:in `<top (required)>'
      01
      01 Caused by:
      01 LoadError: cannot load such file -- bundler/setup
      01 /home/poladmin/poetry_out_loud_v2/releases/20180629214135/config/boot.rb:3:in `<top (required)>'
      01 /home/poladmin/poetry_out_loud_v2/releases/20180629214135/config/application.rb:1:in `require_relative'
      01 /home/poladmin/poetry_out_loud_v2/releases/20180629214135/config/application.rb:1:in `<top (required)>'
      01 /home/poladmin/poetry_out_loud_v2/releases/20180629214135/Rakefile:4:in `require_relative'
      01 /home/poladmin/poetry_out_loud_v2/releases/20180629214135/Rakefile:4:in `<top (required)>'
      01 (See full trace by running task with --trace)
#<Thread:0x000056102ca202a0@/home/ben/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/sshkit-1.16.1/lib/sshkit/runners/parallel.rb:10 run> terminated with exception (report_on_exception is true):
Traceback (most recent call last):
        1: from /home/ben/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/sshkit-1.16.1/lib/sshkit/runners/parallel.rb:11:in `block (2 levels) in execute'
/home/ben/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/sshkit-1.16.1/lib/sshkit/runners/parallel.rb:15:in `rescue in block (2 levels) in execute': Exception while executing as poladmin@196.28.51.162: rake exit status: 1 (SSHKit::Runner::ExecuteError)
rake stdout: Nothing written
rake stderr: rake aborted!
Bundler::GemNotFound: Could not find rake-12.3.1 in any of the sources
/home/poladmin/poetry_out_loud_v2/releases/20180629214135/config/boot.rb:3:in `<top (required)>'
/home/poladmin/poetry_out_loud_v2/releases/20180629214135/config/application.rb:1:in `require_relative'
/home/poladmin/poetry_out_loud_v2/releases/20180629214135/config/application.rb:1:in `<top (required)>'
/home/poladmin/poetry_out_loud_v2/releases/20180629214135/Rakefile:4:in `require_relative'
/home/poladmin/poetry_out_loud_v2/releases/20180629214135/Rakefile:4:in `<top (required)>'

Caused by:
LoadError: cannot load such file -- bundler/setup
/home/poladmin/poetry_out_loud_v2/releases/20180629214135/config/boot.rb:3:in `<top (required)>'
/home/poladmin/poetry_out_loud_v2/releases/20180629214135/config/application.rb:1:in `require_relative'
/home/poladmin/poetry_out_loud_v2/releases/20180629214135/config/application.rb:1:in `<top (required)>'
/home/poladmin/poetry_out_loud_v2/releases/20180629214135/Rakefile:4:in `require_relative'
/home/poladmin/poetry_out_loud_v2/releases/20180629214135/Rakefile:4:in `<top (required)>'
(See full trace by running task with --trace)
(Backtrace restricted to imported tasks)
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing as poladmin@196.28.51.162: rake exit status: 1
rake stdout: Nothing written
rake stderr: rake aborted!
Bundler::GemNotFound: Could not find rake-12.3.1 in any of the sources
/home/poladmin/poetry_out_loud_v2/releases/20180629214135/config/boot.rb:3:in `<top (required)>'
/home/poladmin/poetry_out_loud_v2/releases/20180629214135/config/application.rb:1:in `require_relative'
/home/poladmin/poetry_out_loud_v2/releases/20180629214135/config/application.rb:1:in `<top (required)>'
/home/poladmin/poetry_out_loud_v2/releases/20180629214135/Rakefile:4:in `require_relative'
/home/poladmin/poetry_out_loud_v2/releases/20180629214135/Rakefile:4:in `<top (required)>'

Caused by:
LoadError: cannot load such file -- bundler/setup
/home/poladmin/poetry_out_loud_v2/releases/20180629214135/config/boot.rb:3:in `<top (required)>'
/home/poladmin/poetry_out_loud_v2/releases/20180629214135/config/application.rb:1:in `require_relative'
/home/poladmin/poetry_out_loud_v2/releases/20180629214135/config/application.rb:1:in `<top (required)>'
/home/poladmin/poetry_out_loud_v2/releases/20180629214135/Rakefile:4:in `require_relative'
/home/poladmin/poetry_out_loud_v2/releases/20180629214135/Rakefile:4:in `<top (required)>'
(See full trace by running task with --trace)


Caused by:
SSHKit::Command::Failed: rake exit status: 1
rake stdout: Nothing written
rake stderr: rake aborted!
Bundler::GemNotFound: Could not find rake-12.3.1 in any of the sources
/home/poladmin/poetry_out_loud_v2/releases/20180629214135/config/boot.rb:3:in `<top (required)>'
/home/poladmin/poetry_out_loud_v2/releases/20180629214135/config/application.rb:1:in `require_relative'
/home/poladmin/poetry_out_loud_v2/releases/20180629214135/config/application.rb:1:in `<top (required)>'
/home/poladmin/poetry_out_loud_v2/releases/20180629214135/Rakefile:4:in `require_relative'
/home/poladmin/poetry_out_loud_v2/releases/20180629214135/Rakefile:4:in `<top (required)>'

Caused by:
LoadError: cannot load such file -- bundler/setup
/home/poladmin/poetry_out_loud_v2/releases/20180629214135/config/boot.rb:3:in `<top (required)>'
/home/poladmin/poetry_out_loud_v2/releases/20180629214135/config/application.rb:1:in `require_relative'
/home/poladmin/poetry_out_loud_v2/releases/20180629214135/config/application.rb:1:in `<top (required)>'
/home/poladmin/poetry_out_loud_v2/releases/20180629214135/Rakefile:4:in `require_relative'
/home/poladmin/poetry_out_loud_v2/releases/20180629214135/Rakefile:4:in `<top (required)>'
(See full trace by running task with --trace)

Tasks: TOP => deploy:assets:precompile
(See full trace by running task with --trace)
The deploy has failed with an error: Exception while executing as poladmin@196.28.51.162: rake exit status: 1
rake stdout: Nothing written
rake stderr: rake aborted!
Bundler::GemNotFound: Could not find rake-12.3.1 in any of the sources
/home/poladmin/poetry_out_loud_v2/releases/20180629214135/config/boot.rb:3:in `<top (required)>'
/home/poladmin/poetry_out_loud_v2/releases/20180629214135/config/application.rb:1:in `require_relative'
/home/poladmin/poetry_out_loud_v2/releases/20180629214135/config/application.rb:1:in `<top (required)>'
/home/poladmin/poetry_out_loud_v2/releases/20180629214135/Rakefile:4:in `require_relative'
/home/poladmin/poetry_out_loud_v2/releases/20180629214135/Rakefile:4:in `<top (required)>'

Caused by:
LoadError: cannot load such file -- bundler/setup
/home/poladmin/poetry_out_loud_v2/releases/20180629214135/config/boot.rb:3:in `<top (required)>'
/home/poladmin/poetry_out_loud_v2/releases/20180629214135/config/application.rb:1:in `require_relative'
/home/poladmin/poetry_out_loud_v2/releases/20180629214135/config/application.rb:1:in `<top (required)>'
/home/poladmin/poetry_out_loud_v2/releases/20180629214135/Rakefile:4:in `require_relative'
/home/poladmin/poetry_out_loud_v2/releases/20180629214135/Rakefile:4:in `<top (required)>'
(See full trace by running task with --trace)

由于尺寸大,所以要紧。

这是服务器上的gem列表

*** LOCAL GEMS ***

actioncable (5.2.0)
actionmailer (5.2.0)
actionpack (5.2.0)
actionview (5.2.0)
activejob (5.2.0)
activemodel (5.2.0)
activerecord (5.2.0)
activestorage (5.2.0)
activesupport (5.2.0)
arel (9.0.0)
bigdecimal (default: 1.3.4)
builder (3.2.3)
bundler (1.16.2)
cmath (default: 1.0.0)
concurrent-ruby (1.0.5)
crass (1.0.4)
csv (default: 1.0.0)
date (default: 1.0.0)
did_you_mean (1.2.0)
erubi (1.7.1)
etc (default: 1.0.0)
fcntl (default: 1.0.0)
fiddle (default: 1.0.0)
fileutils (default: 1.0.2)
globalid (0.4.1)
i18n (1.0.1)
io-console (default: 0.4.6)
ipaddr (default: 1.2.0)
json (default: 2.1.0)
loofah (2.2.2)
mail (2.7.0)
marcel (0.3.2)
method_source (0.9.0)
mimemagic (0.3.2)
mini_mime (1.0.0)
mini_portile2 (2.3.0)
minitest (5.10.3)
net-telnet (0.1.1)
nio4r (2.3.1)
nokogiri (1.8.3)
openssl (default: 2.1.0)
power_assert (1.1.1)
psych (default: 3.0.2)
rack (2.0.5)
rack-test (1.0.0)
rails (5.2.0)
rails-dom-testing (2.0.3)
rails-html-sanitizer (1.0.4)
railties (5.2.0)
rake (12.3.0)
rdoc (default: 6.0.1)
scanf (default: 1.0.0)
sdbm (default: 1.0.0)
sprockets (3.7.2)
sprockets-rails (3.2.1)
stringio (default: 0.0.1)
strscan (default: 1.0.0)
test-unit (3.2.7)
thor (0.20.0)
thread_safe (0.3.6)
tzinfo (1.2.5)
webrick (default: 1.4.2)
websocket-driver (0.7.0)
websocket-extensions (0.1.3)
xmlrpc (0.3.0)
zlib (default: 1.0.0)

1 个答案:

答案 0 :(得分:0)

如果您的项目中有Gemfile,则可以尝试将bundle install添加到部署步骤之一中,并安装所有必需的ruby gem。另外,由于耙版本不匹配,您需要更新Gemfile和Gemfile.lock以使其首先与所需版本匹配。