1

我在使用 Capistrano 部署 Rails 应用程序时遇到问题。由于 ec2_domain 错误,我不断收到连接失败。

* 2013-08-24 19:50:51 executing `deploy:setup'
* executing "mkdir -p /home/ubuntu/www/crowdcode /home/ubuntu/www/crowdcode/releases /home/ubuntu/www/crowdcode/shared /home/ubuntu/www/crowdcode/shared/system /home/ubuntu/www/crowdcode/shared/log /home/ubuntu/www/crowdcode/shared/pids"
servers: [ec2_domain]
connection failed for: ec2_domain (SocketError: getaddrinfo: Name or service not known)

这是我的 deploy.rb 文件中的内容。

require "bundler/capistrano"

#set :application, "set your application name here"
set :repository,  "https://github.com/path/to/code.git"
set :scm, :git
set :branch, "master"

set :user, "ubuntu"
set :use_sudo, false
set :deploy_to, "/home/ubuntu/www/crowdcode"

# set :scm, :git # You can set :scm explicitly or Capistrano will make an intelligent    guess based on known version control directory names
# Or: `accurev`, `bzr`, `cvs`, `darcs`, `git`, `mercurial`, `perforce`, `subversion` or `none`

role :web, ec2_domain                          # Your HTTP server, Apache/etc
role :app, ec2_domain                          # This may be the same as your `Web` server
role :db,  ec2_domain, :primary => true # This is where Rails migrations will run
#role :db,  "your slave db-server here"

# if you want to clean up old releases on each deploy uncomment this:
# after "deploy:restart", "deploy:cleanup"

# if you're still using the script/reaper helper you will need
# these http://github.com/rails/irs_process_scripts

# If you are using Passenger mod_rails uncomment this:
namespace :deploy do
  task :start do ; end
  task :stop do ; end
  task :restart, :roles => :app, :except => { :no_release => true } do
    run "#{try_sudo} touch #{File.join(current_path,'tmp','restart.txt')}"
  end
end

ssh_options[:keys] = ["/home/ubuntu/.ssh/first_pair.pem"]
ssh_options[:forward_agent] = true

我不确定是什么导致了这个错误。我看过一些教程,但似乎无法修复错误。任何人都知道问题可能是什么?

4

0 回答 0