【问题标题】:SSHKit::Runner::ExecuteError: Exception while executing on host [host]: getaddrinfo: No such host is knownSSHKit::Runner::ExecuteError: 在主机 [host] 上执行时出现异常:getaddrinfo: No such host is known
【发布时间】:2014-08-28 13:11:50
【问题描述】:

我一直在尝试将我的应用部署到 vps 并收到此错误!部署失败并出现错误:#

这是我的 deploy.rb

# config valid only for Capistrano 3.1
lock '3.2.1'

set :application, 'appname'
set :repo_url, 'https://someone@bitbucket.org/'
set :branch, 'master'
set :scm, :git
set :deploy_to, '/home/dir'

set :deploy_via, :remote_catche

set :user, "user"
set :scm_username, "username"
set :use_sudo, false

#default_run_options[:pty] = true tried uncomenting this and it threw me an error 

# Default value for :scm is :git


# Default value for :format is :pretty
# set :format, :pretty

# Default value for :log_level is :debug
# set :log_level, :debug


 namespace :deploy do
 desc "Restart nginx"
 task :restart do
 run "#{deploy_to}/bin/restart"
 end
 end

这是我的 production.rb

role :app, %w{web334.webfaction.com‏}
role :web, %w{web334.webfaction.com‏}
role :db,  %w{postgres}

我该怎么做才能成功部署这个应用程序,帮助

【问题讨论】:

    标签: ruby-on-rails ruby capistrano vps


    【解决方案1】:

    production.rb 文件中,这个role :db, %w{postgres} 看起来不对。这样,capistrano 将使用postgres 作为数据库服务器 url,这自然会失败。

    为什么你没有服务器 url 或 ip 而不是postgres?我想应该是这样的:

    role :db, %w{web334.webfaction.com‏}
    

    如果您的应用没有数据库,请随时删除 db 角色。

    【讨论】:

    • 它仍然给我这个错误,SSHKit::Runner::ExecuteError: Exception while execution on host web334.webfactio n.com?: getaddrinfo: No such host is known.
    猜你喜欢
    • 2015-12-14
    • 2015-09-25
    • 2018-07-12
    • 2016-10-16
    • 1970-01-01
    • 1970-01-01
    • 2016-01-26
    • 1970-01-01
    • 2010-11-19
    相关资源
    最近更新 更多