我尝试通过gem Capistrano将我的应用程序部署到主机时出现问题。SSHKit :: Runner :: ExecuteError:执行时出现异常
我有一个出错列表:
(Backtrace restricted to imported tasks)
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing as [email protected]: rake exit status: 1
我deploy.rb文件是:
lock '3.4.0'
application = 'yurta24'
login = 'yurta24'
$user = 'hosting_' + login
$server = 'calcium.locum.ru'
rvm_ruby_string = '2.1.5p273'
deploy_to = "/home/#{ $user }/projects/#{ application }"
unicorn_conf = "/etc/unicorn/#{ application }.#{ login }.rb"
unicorn_pid = "/var/run/unicorn/#{ $user }/#{ application }.#{ login }.pid"
unicorn_start_cmd = "(cd #{ deploy_to }/current; rvm use #{ rvm_ruby_string } do bundle exec unicorn_rails -DC#{ unicorn_conf })"
set :application, application
set :repo_url, "https://github.com/verrom/yurta24.git"
set :deploy_to, deploy_to
set :pty, true
set :default_env, { path: "xxxxx" }
namespace :deploy do
after :restart, :clear_cache do
on roles(:web), in: :groups, limit: 3, wait: 10 do
end
end
我production.rb文件是:
connect_to = "#{$user}@#{$server}"
role :app, [connect_to]
role :web, [connect_to]
role :db, [connect_to]
set :enable_ssl, true
全部更新错误报告后更新database.yml是:
[email protected]:~/apps/yurta24$ cap production deploy
DEBUG [191cfb48] Running /usr/bin/env [ -d ~/.rvm ] as [email protected]
DEBUG [191cfb48] Command: [ -d ~/.rvm ]
Text will be echoed in the clear. Please install the HighLine or Termios libraries to suppress echoed text.
[email protected]'s password:xxxxxxxxxxx
DEBUG [191cfb48] Finished in 5.999 seconds with exit status 1 (failed).
DEBUG [cba4e265] Running /usr/bin/env [ -d /usr/local/rvm ] as [email protected]
DEBUG [cba4e265] Command: [ -d /usr/local/rvm ]
DEBUG [cba4e265] Finished in 0.171 seconds with exit status 0 (successful).
DEBUG [363e1014] Running /usr/local/rvm/bin/rvm version as [email protected]
DEBUG [363e1014] Command: (PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/usr/local/rvm/bin /usr/local/rvm/bin/rvm version)
DEBUG [363e1014] rvm 1.26.11 (latest) by Wayne E. Seguin <[email protected]>, Michal Papis <[email protected]> [https://rvm.io/]
DEBUG [363e1014] Finished in 0.374 seconds with exit status 0 (successful).
rvm 1.26.11 (latest) by Wayne E. Seguin <[email protected]>, Michal Papis <[email protected]> [https://rvm.io/]
DEBUG [0810a260] Running /usr/local/rvm/bin/rvm current as [email protected]
DEBUG [0810a260] Command: (PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/usr/local/rvm/bin /usr/local/rvm/bin/rvm current)
DEBUG [0810a260] system
DEBUG [0810a260] Finished in 0.391 seconds with exit status 0 (successful).
system
DEBUG [769f1945] Running /usr/local/rvm/bin/rvm default do ruby --version as [email protected]
DEBUG [769f1945] Command: (PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/usr/local/rvm/bin /usr/local/rvm/bin/rvm default do ruby --version)
DEBUG [769f1945] ruby 2.1.5p273 (2014-11-13) [x86_64-linux-gnu]
DEBUG [769f1945]
DEBUG [769f1945] Finished in 0.605 seconds with exit status 0 (successful).
ruby 2.1.5p273 (2014-11-13) [x86_64-linux-gnu]
INFO [b1cf993c] Running /usr/bin/env mkdir -p /tmp/yurta24/ as [email protected]
DEBUG [b1cf993c] Command: (PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/usr/local/rvm/bin /usr/bin/env mkdir -p /tmp/yurta24/)
INFO [b1cf993c] Finished in 0.170 seconds with exit status 0 (successful).
DEBUG Uploading /tmp/yurta24/git-ssh.sh 0.0%
(Backtrace restricted to imported tasks)
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing as [email protected]: scp: /tmp/yurta24/git-ssh.sh: Permission denied
scp: /tmp/yurta24/git-ssh.sh: Permission denied
Tasks: TOP => git:check => git:wrapper
(See full trace by running task with --trace)
The deploy has failed with an error: Exception while executing as [email protected]: scp: /tmp/yurta24/git-ssh.sh: Permission denied
[email protected]:~/apps/yurta24$ git checkout
M config/deploy.rb
谢谢
我们可以看到完整的错误报告吗?这何时失败?在它失败之前它是否通过特定的卡皮斯特拉诺配方? – moeabdol
也尝试$ cap生产部署:检查,并在那里报告相同的错误? – moeabdol
@moeabdo,嗨。我已更新我的问题。是的,在它失败之前,它会通过特定的卡皮斯特拉诺配方。是的,我想,错误是一样的。 – verrom