我尝试使用capistrano 3部署我的rails应用程序,但是当我运行cap production deploy --trace
时出现此错误消息:
** Invoke production (first_time)
** Execute production
** Invoke load:defaults (first_time)
** Execute load:defaults
** Invoke deploy (first_time)
** Execute deploy
** Invoke deploy:starting (first_time)
** Execute deploy:starting
** Invoke deploy:check (first_time)
** Execute deploy:check
** Invoke git:check (first_time)
** Invoke git:wrapper (first_time)
** Execute git:wrapper
INFO [707e609f] Running /usr/bin/env mkdir -p /tmp/my_app_name/ on 88.xxx.xxx.xxx
DEBUG [707e609f] Command: /usr/bin/env mkdir -p /tmp/my_app_name/
cap aborted!
deploy
/var/lib/gems/1.9.1/gems/net-ssh-2.7.0/lib/net/ssh.rb:215:in `start'
/var/lib/gems/1.9.1/gems/sshkit-1.2.0/lib/sshkit/backends/netssh.rb:169:in `ssh'
/var/lib/gems/1.9.1/gems/sshkit-1.2.0/lib/sshkit/backends/netssh.rb:122:in `block in _execute'
/var/lib/gems/1.9.1/gems/sshkit-1.2.0/lib/sshkit/backends/netssh.rb:119:in `tap'
/var/lib/gems/1.9.1/gems/sshkit-1.2.0/lib/sshkit/backends/netssh.rb:119:in `_execute'
/var/lib/gems/1.9.1/gems/sshkit-1.2.0/lib/sshkit/backends/netssh.rb:66:in `execute'
/var/lib/gems/1.9.1/gems/capistrano-3.0.1/lib/capistrano/tasks/git.rake:13:in `block (3 levels) in <top (required)>'
/var/lib/gems/1.9.1/gems/sshkit-1.2.0/lib/sshkit/backends/netssh.rb:54:in `instance_exec'
/var/lib/gems/1.9.1/gems/sshkit-1.2.0/lib/sshkit/backends/netssh.rb:54:in `run'
/var/lib/gems/1.9.1/gems/sshkit-1.2.0/lib/sshkit/runners/parallel.rb:12:in `block (2 levels) in execute'
Tasks: TOP => git:check => git:wrapper
它似乎来自我的git存储库。这是我的deploy.rb和production.rb:
deploy.rb :
set :application, 'my_app_name'
set :deploy_to, '/var/www/my_app/'
set :deploy_via, :copy
set :scm, :git
set :repo_url, 'file://.git/'
production.rb :
set :stage, :production
role :app, %w{deploy@88.xxx.xxx.xxx}
role :web, %w{deploy@88.xxx.xxx.xxx}
答案 0 :(得分:1)
您可以在本地用户部署时运行此命令mkdir -p /tmp/my_app_name/
吗?我的猜测是用户部署没有创建该目录所需的权限。