Deploying via Capistrano is supposed to be painless. Unfortunately, the Dreamhost Wiki entry on it gives an approach that doesn’t work for me.
Specifically, I either timeout or get a connection refused on the connect.
I have public key authentication working. I can ssh to the account from the shell prompt and not be asked for a password.
I also know that it’s not a problem with Net::SSH, because hand-tooling the connection from irb works:
require 'net/ssh'
Net::SSH.start('www.drinkingfromthefirehydrant.com','hydrant',:keys => %w(/Users/jnich/.ssh/id_dsa)) do |ssh|
output = ssh.exec!("hostname")
puts output
end
My config file looks like this:
set :user, 'hydrant'
role :app, "www.drinkingfromthefirehydrant.com"
ssh_options[:keys] = %w(/Users/jnich/.ssh/id_dsa)
Given this, I should be able to run “cap shell” and enter a command like “on app hostname” and see it work, but instead I get things like
connection failed for: app (Errno::ECONNREFUSED: Connection refused – connect(2))
Aside: In looking into how Capistrano uses Net::SSH, I found this page from Jamis that describes how Capistrano uses Net::SSH internally. Of note is this particular line:
config.logger = Capistrano::Logger.new(:output => "/dev/null")
One of the reasons people sneer at Rails as a platform for enterprise-class applications is crap like this. If you hard-coded the logger to /dev/null in a production class, don’t expect people to take your code seriously, no matter how many f-bombs your team lead drops when making public speeches.
Updated:I’ve resolved my Dreamhost/Rails deployment issues without using Capistrano for the moment. Somehow, in the course of messing around, I managed to make my Dreamhost home directory group-writeable, which had the effect making the Dreamhost sshd ignore my .ssh directory (since it was potentially compromised.)
To deploy, I simply did an svn checkout. That makes more sense to me than the Capistrano method, which involves endless messing around with symlinks and archived copies of the application.
Follow Us!