Capistrano生产部署问题

时间:2014-02-03 00:14:45

标签: ruby-on-rails-4 capistrano3

我运行以下命令在Rackspace云上准备我的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 [4761f9bd] Running /usr/bin/env mkdir -p /tmp/my_app_name/ on example.com
DEBUG [4761f9bd] Command: /usr/bin/env mkdir -p /tmp/my_app_name/
cap aborted!
No route to host - connect(2)
/Users/fr/.rvm/gems/ruby-2.0.0-p247/gems/net-ssh-2.8.0/lib/net/ssh/transport/session.rb:70:in `initialize'
/Users/fr/.rvm/gems/ruby-2.0.0-p247/gems/net-ssh-2.8.0/lib/net/ssh/transport/session.rb:70:in `open'
/Users/fr/.rvm/gems/ruby-2.0.0-p247/gems/net-ssh-2.8.0/lib/net/ssh/transport/session.rb:70:in `block in initialize'
/Users/fr/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/timeout.rb:52:in `timeout'
/Users/fr/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/timeout.rb:97:in `timeout'
/Users/fr/.rvm/gems/ruby-2.0.0-p247/gems/net-ssh-2.8.0/lib/net/ssh/transport/session.rb:67:in `initialize'
/Users/fr/.rvm/gems/ruby-2.0.0-p247/gems/net-ssh-2.8.0/lib/net/ssh.rb:200:in `new'
/Users/fr/.rvm/gems/ruby-2.0.0-p247/gems/net-ssh-2.8.0/lib/net/ssh.rb:200:in `start'
/Users/fr/.rvm/gems/ruby-2.0.0-p247/gems/sshkit-1.3.0/lib/sshkit/backends/connection_pool.rb:25:in `create_or_reuse_connection'
/Users/fr/.rvm/gems/ruby-2.0.0-p247/gems/sshkit-1.3.0/lib/sshkit/backends/netssh.rb:173:in `ssh'
/Users/fr/.rvm/gems/ruby-2.0.0-p247/gems/sshkit-1.3.0/lib/sshkit/backends/netssh.rb:126:in `block in _execute'
/Users/fr/.rvm/gems/ruby-2.0.0-p247/gems/sshkit-1.3.0/lib/sshkit/backends/netssh.rb:123:in `tap'
/Users/fr/.rvm/gems/ruby-2.0.0-p247/gems/sshkit-1.3.0/lib/sshkit/backends/netssh.rb:123:in `_execute'
/Users/fr/.rvm/gems/ruby-2.0.0-p247/gems/sshkit-1.3.0/lib/sshkit/backends/netssh.rb:66:in `execute'
/Users/fr/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-3.1.0/lib/capistrano/tasks/git.rake:17:in `block (3 levels) in <top (required)>'
/Users/fr/.rvm/gems/ruby-2.0.0-p247/gems/sshkit-1.3.0/lib/sshkit/backends/netssh.rb:54:in `instance_exec'
/Users/fr/.rvm/gems/ruby-2.0.0-p247/gems/sshkit-1.3.0/lib/sshkit/backends/netssh.rb:54:in `run'
/Users/fr/.rvm/gems/ruby-2.0.0-p247/gems/sshkit-1.3.0/lib/sshkit/runners/parallel.rb:12:in `block (2 levels) in execute'
Tasks: TOP => git:check => git:wrapper
The deploy has failed with an error: #<Errno::EHOSTUNREACH: No route to host - connect(2)>
** Invoke deploy:failed (first_time)
** Execute deploy:failed

我试着查看这些错误指向的内容,但我很清楚为什么会显示“无路由到主机”的消息。

1 个答案:

答案 0 :(得分:0)

在日志输出中,我看到对example.com的引用,这可能解释了您获得的No route to host error

您是否在deploy.rb中指定了目标服务器的域/ ip,如下所示:

role :web, %w{your_server.com} 

如此处所述:http://capistranorb.com/documentation/getting-started/preparing-your-application/