1

I am trying to upload my rails app to free-tier ec2 instance using rubber gem. Using railcast video and following this tutorial https://liggat.org/a-full-AWS-rails-stack-provision-and-deployment-with-the-rubber-gem/

Using cap rubber:create, I am able to create ec2 instance, but it does not get connected. I get the following error:

** 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'

Also rubber does not update /etc/hosts file. But interestingly when I ssh into remote instance through

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

it gets connected. Also, cap rubber:bootstrap fails after this, giving this error

* 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)

I am stuck on this for 5 days. if some kind soul can help, I would really be obliged.

Somnath Das
  • 163
  • 2
  • 10
  • In rubber.yml in your app you have a `key_file` attribute that represents the path to a file where you have to add your amazon keys etc. Is this file present in your case ? – Mkou Jan 04 '18 at 01:47

0 Answers0