1

我正在尝试使用rubbergem 将我的 rails 应用程序上传到免费层 ec2 实例。使用 railcast 视频并遵循本教程 https://liggat.org/a-full-AWS-rails-stack-provision-and-deployment-with-the-rubber-gem/

使用cap rubber:create,我可以创建 ec2 实例,但它没有连接。我收到以下错误:

** Failed to connect to xx.xxx.xxx.xx, retrying
  * 2017-10-31 19:10:56 executing `rubber:_ensure_key_file_present'
    servers: ["xx.xxx.xxx.xx"]
/Users/somnathdas/.rvm/gems/ruby-2.4.0/gems/net-ssh-2.9.4/lib/net/ssh.rb:197: warning: constant ::Fixnum is deprecated
/Users/somnathdas/.rvm/gems/ruby-2.4.0/gems/net-ssh-2.9.4/lib/net/ssh/transport/session.rb:67:in `initialize': Object#timeout is deprecated, use Timeout.timeout instead.
/Users/somnathdas/.rvm/gems/ruby-2.4.0/gems/net-ssh-2.9.4/lib/net/ssh/transport/session.rb:84:in `initialize': Object#timeout is deprecated, use Timeout.timeout instead.
./Users/somnathdas/.rvm/gems/ruby-2.4.0/gems/net-ssh-2.9.4/lib/net/ssh/transport/cipher_factory.rb:98: warning: constant OpenSSL::Cipher::Cipher is deprecated
. ** Failed to connect to xx.xxx.xxx.xx, retrying
  * 2017-10-31 19:10:59 executing `rubber:_ensure_key_file_present'

也不rubber更新/etc/hosts文件。但有趣的是,当我通过 ssh 进入远程实例时

ssh -v -i ~/.ec2/gsg-keypair ubuntu@ec2-xx.xxx.xxx.xx.us-west-2.compute.amazonaws.com

它连接起来。此外,cap rubber:bootstrap在此之后失败,给出此错误

* 2017-10-31 19:13:17 executing `rubber:bootstrap'
    triggering before callbacks for `rubber:bootstrap'
  * 2017-10-31 19:13:17 executing `rubber:base:update_sudoers'
    servers: ["production.xxxxx.io"]
/Users/somnathdas/.rvm/gems/ruby-2.4.0/gems/net-ssh-2.9.4/lib/net/ssh.rb:197: warning: constant ::Fixnum is deprecated
/Users/somnathdas/.rvm/gems/ruby-2.4.0/gems/net-ssh-2.9.4/lib/net/ssh/transport/session.rb:67:in `initialize': Object#timeout is deprecated, use Timeout.timeout instead.
connection failed for: production.xxxx.io (SocketError: getaddrinfo: nodename nor servname provided, or not known)

我坚持了5天。如果某个善良的灵魂可以提供帮助,我真的很感激。

4

0 回答 0