I am using Capistrano 3. In the past I could successfully deploy to my server.
Now the server migrated and has new parameters:
authorized_keys
) staging.rb
accordingly along with SSH Credentials) cap
could connect to my new server so the Auth seemed fine. current
directory However, I got an Error when using cap staging deploy
:
SSHKit::Command::Failed: if test ! -d /var/www/my-project/subdomains/dev/current; then echo "Directory does not exist '/var/www/my-project/subdomains/dev/current'" 1>&2; false; fi exit status: 1
I checked and the curiously the current
directory was still there (migrated along with the rest). I deleted the current
directory because this will be created on the deploy (I thought then).
On the next deploy I got the same error. So I did some googling and I ended up adding the following hook:
# Had to insert this hook after migrating the server
# Maybe this can be removed after the first successful deployment
after 'deploy:set_current_revision', 'deploy:symlink:release'
I think this is not a very clean approach but from then on the current
directory was created and I got a little farther with cap staging deploy
.
Now whenever I setup Capistrano I am amazed how painless it works but now since I have moved to another server I keep running into issues.
I wonder:
deploy.rb
or staging|production.rb
respectively? I managed to fix my deploy and I am not sure which of the steps I took were really required. I documented the solution in this SO Post: Bundler in deployment mode does not find Gems
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.