cap deploy:设置给出(Errno :: ETIMEDOUT:操作超时 - 连接(2))

时间:2012-01-31 06:20:50

标签: ruby-on-rails-3 amazon-ec2 osx-lion capistrano

我一直在尝试使用capistrano从我的mac(os lion)部署一个简单的rails3应用程序到亚马逊ec2实例。当我执行上限部署:设置时,我的连接失败:http://ec2-xxx-xx-xx-xxx.compute-1.amazonaws.com/(错误:: ETIMEDOUT:操作超时 - 连接(2))

这是我的config / deploy.rb

set :application, "paperclip_sample_app"
set :deploy_to, "/mnt/#{application}"
set :deploy_via, :copy
set :scm, :git
set :repository,  "."

default_run_options[:pty] = true 
set :location, "http://ec2-xxx-xx-xx-xxx.compute-1.amazonaws.com/"

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

set :user, "root"
ssh_options[:keys] = [File.join(ENV["HOME"], ".ssh", "id_rsa")]

我还通过转到'系统偏好设置'在Mac上启用了ssh。在'Internet&联网','共享'图标并选中“远程登录”选项。

ec2实例上的安全组也启用了端口22。结果我能够ssh到实例中。

我有什么遗失的吗?任何帮助将不胜感激。

由于

1 个答案:

答案 0 :(得分:0)

我需要改变

set :location, "http://ec2-xxx-xx-xx-xxx.compute-1.amazonaws.com/"

set :location, "ec2-xxx-xx-xx-xxx.compute-1.amazonaws.com"

这解决了问题。