Q:

capistrano 3 set ssh port but 22 is still used

I'm trying to set up access to server via a port (ssh is on port 222), but still although i have in my deploy.rb 

set :application, 'billing'
  set :repo_url, 'git@github.com:random/stat.git'
  set :keep_releases, 5
  set :ssh_options, {
      forward_agent: true,
      port: 222
  }
  SSHKit.config.command_map[:rake]  = "bundle exec rake" #8
  SSHKit.config.command_map[:rails] = "bundle exec rails"  

I still get error
SSHKit::Runner::ExecuteError: Exception while executing on host IP:
Operation timed out - connect(2) for "IP" port 22

How can i solve this error? what i'm doing wrong?

A:

I was also having issues with ssh_options option.
I switched to using server method, so it looks something like this:
# config/deploy/production.rb
server "#{server_ip_here}", user: "deploy", roles: %w{web app db}, port: 222

