“could not open channel” after cap deploy:setup

Capistrano, Ruby on Rails No Comments »

After extensive setup work to deploy your Ruby on Rails app with capistrano and after you put 

set :user, “deploy”

as a dedicated deploy user into your deploy.rb as many advise, you finally get to run

cap deploy:setup

Then this error stares back at you:

 servers: ["mydomain.com"]
*** [mydomain.com] could not open channel
    command finished
failed: nil on mydomain.com

Check you auth.log on your remote server

tail -f /var/log/auth.log

and look at the message:

Accepted publickey for myuser

This myuser, who lacks the necessary deployment permissions on your server, might be set in your ~/.ssh/config file, possibly after you set a custom port for ssh (sample custom port 30440 used from here on):

Host mydomain.com
User myuser
Port 30440

[…other settings…]

Some say this file (~/.ssh/config) is ignored by capistrano, but this does not seem to be the case, and capistrano will always make the ssh connection with the first user found in the ~/.ssh/config file, so it doesn’t help if you add

Host mydomain.com
User deploy
Port 30440
[…other settings…]

to the file or to add

set :admin_runner, “deploy

to your deploy.rb, rather you can have only

Host mydomain.com
User deploy
Port 30440
[…other settings…]

in your ~/.ssh/config file for this particular host if you want to specify the user here.

As a side note, capistrano has no problems connecting on a custom ssh port if you set

ssh_options[:port] = 30440

so it might be time to clean out your ~/.ssh/config file for the hosts you deploy to with capistrano.

Specifying the port however won’t work with gitosis and git, i.e. you can’t have

set :repository, “ssh://git@mydomain.com:30440/myrepository.git”

in your deploy.rb file, as it will throw a

ssh: mydomain.com:30440: Name or service not known

, likely because of a gitosis issue. As a workaround you might just put

Host mydomain.com
Port 30440

[…other settings but no user specified…]

without any user settings into your ~/.ssh/config file for this particular host, and you’ll (hopefully) be able to deploy via a custom port with gitosis and capistrano.

Hope it helps.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

“Rake… not found” when Installing Phusion Passenger

Ruby on Rails 3 Comments »

This error is usually preceded by

sudo: passenger-install-apache2-module: command not found

so you run the full path:


sudo /var/lib/gems/1.8/bin/passenger-install-apache2-module

but there’s no way around the “Rake… not found” error as the phusion install can’t see rake. As outlined here, you’ll have to

export PATH=$PATH:/var/lib/gems/1.8/bin

and then run the naked

passenger-install-apache2-module

again.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

All Fall Down - Including the Bucket of Formulas

Unspecific Ramblings No Comments »

As the Economist’s Buttonwood points out, when everyone heads for the exit, all get squeezed. This defeats all hedging strategies. The late eighties and nineties brought us the end of a formulaic approach to politics (Socialism vs. Capitalism); the current decade follows up with the end of a formulaic approach to investing (Long vs. Short, Stocks vs. Bonds etc.).

brilliant comment by Hyun-U Sohn sums it up:

The article betrays the view of correlations and other statistics as describing laws of some kind. That you distinguish between dynamic and static correlations and between “short”- and “long”-term ones doesn’t really make a difference. The implicit belief that there are hidden laws, to be uncovered by data analysis and then extrapolated to future investment decisions/ advice, is one of the more fundamental, philosophical factors behind today’s crisis and the rise of financial “engineering” that preceded it.
My own view is that there are no laws, only analogies. Statistics can serve as summaries of history and as expressions of subjective beliefs about the future or about hidden facts. The circumstances that led to the data showing low correlations between, say, commodities and equities in one period were specific to their time. They may or may not look similar in the future, and even if they were completely dissimilar, they may still give rise to a set of similar data for a while before the dissimilarities show, perhaps abruptly.

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]
WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Log in