From: Dave Foo Date: 2009-01-28T02:24:58+09:00 Subject: problems with rake and sh Hi, I am using ssh to login to my Amazon EC2 server, and using a rake task to automate some activities on the machine. Every time I login, it is a new machine, so I have no host keys from the machine and SSH connections pass back the warning that a new key was added to my local known hosts file. When I connect via the shell without using ruby, my command works great with no errors. Inside my rake task, using ruby, I am almost always having the rake task blow out with an error. How can I construct my ruby to shell out without choking on this ssh issue??? eg command: sh "ssh -i /home/foo/.ssh/id_rsa-bs-keypair root@#{@instance[0][:dns_name]} 'mkdir /mnt/data_store && mount /dev/sdf /mnt/data_store'" This is usually resulting in something like: ssh: connect to host ec2-72-44-38-77.compute-1.amazonaws.com port 22: Connection refused rake aborted! Any one know of how I can get this small snippet to work in a ruby task??? Thanks -- Posted via http://www.ruby-forum.com/.