Bedrock & Roots: Copying Production Assets with Capistrano

I’m getting an SSHKit error.

FYI, I’m using this to deploy to shared hosting (MediaTemple’s GridServer), and I’m using Gulp instead. Here’s the error in full:

INFO[e2ba3ad4] Running /usr/bin/env mkdir -p ~/domains/{projectname}/releases/20141002043116/web/app/themes/ext/assets/css on {hostname}
DEBUG[e2ba3ad4] Command: ( WP_ENV=staging /usr/bin/env mkdir -p ~/domains/{projectname}/releases/20141002043116/web/app/themes/ext/assets/css )
INFO[e2ba3ad4] Finished in 0.166 seconds with exit status 0 (successful).
DEBUGUploading web/app/themes/ext/assets/css/main.min.css 0.0%
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing on host {hostname}: scp: ~/domains/{projectname}/releases/20141002043116/web/app/themes/ext/assets/css/main.min.css: No such file or directory
/Library/Ruby/Gems/2.0.0/gems/net-scp-1.2.1/lib/net/scp.rb:398:in `await_response_state'
/Library/Ruby/Gems/2.0.0/gems/net-scp-1.2.1/lib/net/scp.rb:369:in `block (3 levels) in start_command'
/Library/Ruby/Gems/2.0.0/gems/net-ssh-2.9.1/lib/net/ssh/connection/channel.rb:311:in `call'
/Library/Ruby/Gems/2.0.0/gems/net-ssh-2.9.1/lib/net/ssh/connection/channel.rb:311:in `process'
/Library/Ruby/Gems/2.0.0/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:222:in `block in preprocess'
/Library/Ruby/Gems/2.0.0/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:222:in `each'
/Library/Ruby/Gems/2.0.0/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:222:in `preprocess'
/Library/Ruby/Gems/2.0.0/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:205:in `process'
/Library/Ruby/Gems/2.0.0/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:169:in `block in loop'
/Library/Ruby/Gems/2.0.0/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:169:in `loop'
/Library/Ruby/Gems/2.0.0/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:169:in `loop'
/Library/Ruby/Gems/2.0.0/gems/net-ssh-2.9.1/lib/net/ssh/connection/channel.rb:269:in `wait'
/Library/Ruby/Gems/2.0.0/gems/net-scp-1.2.1/lib/net/scp.rb:284:in `upload!'
/Library/Ruby/Gems/2.0.0/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:83:in `block in upload!'
/Library/Ruby/Gems/2.0.0/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:186:in `with_ssh'
/Library/Ruby/Gems/2.0.0/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:82:in `upload!'
config/deploy.rb:88:in `block (4 levels) in <top (required)>'
config/deploy.rb:86:in `each'
config/deploy.rb:86:in `block (3 levels) in <top (required)>'
/Library/Ruby/Gems/2.0.0/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:54:in `instance_exec'
/Library/Ruby/Gems/2.0.0/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:54:in `run'
/Library/Ruby/Gems/2.0.0/gems/sshkit-1.5.1/lib/sshkit/runners/parallel.rb:13:in `block (2 levels) in execute'
scp: ~/domains/{projectname}/releases/20141002043116/web/app/themes/ext/assets/css/main.min.css: No such file or directory
/Library/Ruby/Gems/2.0.0/gems/net-scp-1.2.1/lib/net/scp.rb:398:in `await_response_state'
/Library/Ruby/Gems/2.0.0/gems/net-scp-1.2.1/lib/net/scp.rb:369:in `block (3 levels) in start_command'
/Library/Ruby/Gems/2.0.0/gems/net-ssh-2.9.1/lib/net/ssh/connection/channel.rb:311:in `call'
/Library/Ruby/Gems/2.0.0/gems/net-ssh-2.9.1/lib/net/ssh/connection/channel.rb:311:in `process'
/Library/Ruby/Gems/2.0.0/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:222:in `block in preprocess'
/Library/Ruby/Gems/2.0.0/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:222:in `each'
/Library/Ruby/Gems/2.0.0/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:222:in `preprocess'
/Library/Ruby/Gems/2.0.0/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:205:in `process'
/Library/Ruby/Gems/2.0.0/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:169:in `block in loop'
/Library/Ruby/Gems/2.0.0/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:169:in `loop'
/Library/Ruby/Gems/2.0.0/gems/net-ssh-2.9.1/lib/net/ssh/connection/session.rb:169:in `loop'
/Library/Ruby/Gems/2.0.0/gems/net-ssh-2.9.1/lib/net/ssh/connection/channel.rb:269:in `wait'
/Library/Ruby/Gems/2.0.0/gems/net-scp-1.2.1/lib/net/scp.rb:284:in `upload!'
/Library/Ruby/Gems/2.0.0/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:83:in `block in upload!'
/Library/Ruby/Gems/2.0.0/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:186:in `with_ssh'
/Library/Ruby/Gems/2.0.0/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:82:in `upload!'
config/deploy.rb:88:in `block (4 levels) in <top (required)>'
config/deploy.rb:86:in `each'
config/deploy.rb:86:in `block (3 levels) in <top (required)>'
/Library/Ruby/Gems/2.0.0/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:54:in `instance_exec'
/Library/Ruby/Gems/2.0.0/gems/sshkit-1.5.1/lib/sshkit/backends/netssh.rb:54:in `run'
/Library/Ruby/Gems/2.0.0/gems/sshkit-1.5.1/lib/sshkit/runners/parallel.rb:13:in `block (2 levels) in execute'
Tasks: TOP => deploy:updated => deploy:copy_assets
(See full trace by running task with --trace)
The deploy has failed with an error: #<SSHKit::Runner::ExecuteError: Exception while executing on host {hostname}: scp: ~/domains/{projectname}/releases/20141002043116/web/app/themes/ext/assets/css/main.min.css: No such file or directory

Oddly, when I cd into the release directory, the files do exist, albeit with restrictive permissions.

It seems like a permissions issue to me, but I wouldn’t know how to begin telling Capistrano to chmod directories on the server. Also, Cap is running these commands as the account owner, which is about as close as I’ll get to root on that service; it should have write access to those files.

Thoughts?