我嘗試通過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