0

Trying to get started with a Rails Amazon EC2 deployment using https://github.com/rubber/rubber, and I keep ending up here after attempting to create a staging server with cap rubber:create_staging:

** [out :: production.foo.com] curl: (7) couldn't connect to host command finished in 2022ms
failed: "/bin/bash -l -c 'sudo -p '\\''sudo password: '\\''  bash -l /tmp/create_inputs'" on production.foo.com

I've been sticking with Rubber's quickstart guide, but can't solve this. I'm using rvm, if that makes a difference to anyone.

Any ideas?

Tyler
  • 829
  • 11
  • 26

2 Answers2

0

It looks like you are trying to connect to production.foo.com. Change your configuration to connect to the right remote server or if you are running locally in the EC2 instance you can make it localhost.

Make sure you setup your public ssh key in the ~/.ssh/authorized_keys for the user that you are trying to deploy as. This is to allow capistrano/rubber to do passwordless ssh authentication.

Rico
  • 58,485
  • 12
  • 111
  • 141
0

Reviving an old post here but there's another possible cause of this issue that I've just encountered so figured this might help someone else.

I had to re-create and download a new keypair for my ec2 instances. When I moved it to ~/.ec2/gsg-keypair I forgot to alter the permissions.

When SSH'ing directly into the instance you get the full warning, which makes debugging it easy:

UNPROTECTED PRIVATE KEY FILE! permissions 0644 for 'xxxxx.pem' are too open. It is recommended that your private key files are NOT accessible by others. This private key will be ignored. bad permissions: ignore key: xxxxx.pem Permission denied (publickey).

But when running a rubber task you simply get a generic CURL error. If this is the case for you too just update the permissions like this:

chmod 600 ~/.ec2/gsg-keypair
stuartbates
  • 229
  • 1
  • 10