简体   繁体   中英

Deploying Rails App to AWS/EC2 Using Rubber

I have a question about using the Rubber gem to deploy a Rails app to EC2. When I go about running

cap rubber:create_staging

This line of code runs in a loop.

executing `rubber:_allow_root_ssh' executing "sudo -p 'sudo password: ' bash -l -c 'cp /home/ubuntu/.ssh/authorized_keys /root/.ssh/'" servers: ["witheld"] . Failed to connect to witheld, retrying

I believe this may be an issue with my keypairs. In terms of my keynames, I have a current private key called keyname (plain text file) and a public key called keyname.pub in my config/rubber folder. My rubber.yml file lists

key_name: keyname

key_file: "#{Dir[(File.expand_path('~') rescue '/root') + '/.ec2/*' + cloud_providers.aws.key_name].first}"

I'm pretty sure all other information is correct, but I obviously can't copy and paste it in. Any suggestions?

your keys should be in ~/.ec2/ folder not in config/rubber folder. also make sure you remove .pem extension from your private key file and .pub stays with your public file. Also change key_name: [your private key file name here] in your rubber.yml file.

based on your key_file: settings, rubber will look for these keys in ~/.ec2 folder. So move them to there.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM