I had the hardest time getting Capistrano v3 to work out of the box.

I was challenged with an SSHKit::Runner::ExecuteError error, everytime I ran capistrano's deploy check command:

$: cap staging deploy:check

After a lot of google searching, with no avail. I turned on verbose debugging and tracing.

First I upped the log_level in the deploy.rb file.

set :log_level, :debug  

Then I added verbose logging to the ssh settings in the deploy/staging.rb file:

set :ssh_options, {  
    verbose: :debug

Ran the command with tracing: $: cap staging deploy:check --trace

This led me to find the following error:

fatal: cannot exec '/tmp/capr/git-ssh.sh': Permission denied  

I don't have rights to the tmp folder, which makses sense since I'm actually not deploying on my own server, but a shared server.

We need to update the tmp path in the config to get this to work:

Back to the deploy.rb file:

set :tmp_dir, "<my_shared_home_path>/tmp"  

Re-ran $: cap staging deploy:check --trace, and all was well again.

Also had problems while trying to run composer on the server.

So I opted to use the following configuration based on the capistrano-composer docs:

SHKit.config.command_map[:composer] = "php54 #{shared_path.join("composer.phar")}"  

I downloaded and placed the composer.phar file in my shared folder on the web server.

Notice the php54. I had to specify which php binary I was trying to run on my host, since they default to php 5.3.