Capistrano连接到remote_dir并指定了特定端口

时间:2014-08-14 01:36:37

标签: ruby-on-rails ssh capistrano assets capistrano3

我找到了一个github要点,有人在本地编译rails资产,然后将它们复制到服务器。

它很难连接到服务器,很可能是因为我将ssh端口更改为90.

我怎样才能使这个变量使用端口90连接?

remote_dir = "#{host.user}@#{host.hostname}:#{shared_path}/public/assets/"

通常当我通过ssh连接到服务器时,我会这样做:

ssh myUser@myServer -p90

https://gist.github.com/Jesus/80ef0c8db24c6d3a2745

1 个答案:

答案 0 :(得分:0)

似乎之前已经问过这个问题:Is it possible to specify a different ssh port when using rsync?

诀窍是使用:

run_locally { execute "rsync -av -e 'ssh -p 90' --delete #{local_dir} #{remote_dir}" }

而不是

run_locally { execute "rsync -av --delete #{local_dir} #{remote_dir}" }