I cannot seem to get Capistrano to work with bedrock. I’m getting some sort of error on the deploy:check.
SSHKit::ExecuteError: Exception while executing on host … Connection refused - connect(2) for … port 22.
I think the problem is with the configuration of the staging.rb file inside of the deploy/ folder, but for the sake of it i will explain what i’ve done so far.
So far I have:
Setup bedrock as usual.
Made sure I have ssh access to the server, and also made sure that the repository of the project is not a private repository.
I’ve cloned the Capistrano repo into my bedrock project, after which i moved the capfile, gemfile and gemfile.lock into the root of the project and moved the deploy/ folder and deploy.rb file into the config directory.
After finishing these steps i ran bundle install.
On the server i have setup a test domain: capistrano.somedomain.com, to which i’ve added a .env file with the right configuration for the project, nothing else just the .env file.
I’ve made the following modifications to the deploy.rb file:
- Set the application name to: Capistrano
- Set the git url of the repo, this is without https://, i’m using bitbucket btw
- Set the deploy to path to: /home/user/capistrano.somedomain.com
To the staging.rb file i’ve set the server line to:
ssh -p 4000 user@host
This is the line i use to ssh to the server, i’m not sure this is correct.
A good thing to note would be that i ran the ssh agent to get access to the server.
Thank you for taking the time to help me, any tips would be very welcome!