Rails,Slicehost,Capistrano-部署端口问题 [英] Rails, Slicehost, Capistrano - Deployment port issues
本文介绍了Rails,Slicehost,Capistrano-部署端口问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
尝试通过以下方式部署应用程序时出现端口错误:
I'm getting a port error when I try to deploy my app via:
cap deploy:cold
错误:
ssh: connect to host domain.com port 22: Connection refused
我的deploy.rb(
My deploy.rb (replaced sensitive info where appropriate):
set :user, 'user'
set :domain, 'domain.com'
set :application, "App Name"
# file paths
set :repository, "user@domain.com:git/appname.git"
set :port, 9728
set :deploy_to, "/home/ruby/public_html/appname"
# distribute your applications across servers (the instructions below put them)
# all on the same server, definied above as 'domain', adjust as necessary
role :web, domain
role :app, domain
role :db, domain, :primary => true
# you might need to set this if you aren't seeing password prompts
# default_run_options[:pty] = true
# As Capistrano executes in a non-interactive mode and therefore doesn't cause
# any of your shell profile scripts to be run, the following might be needed
# if (for example) you have locally installed gems or applications. Note:
# this needs to contain the full values for the variables set, not simply
# the deltas.
# miscellaneous options
set :deploy_via, :remote_cache
set :scm, :git
set :branch, 'master'
set :scm_verbose, true
set :use_sudo, false
# task which causes Passenger to initiate a restart
namespace :deploy do
task :restart do
run "touch #{current_path}/tmp/restart.txt"
end
end
# optional task to reconfigure databases
after "deploy:update_code", :configure_database
desc "copy database.yml into the current release path"
task :configure_database, :roles => :app do
do_config = "#{deploy_to}/config/database.yml"
run "cp #{db_config} #{release_path}/config/database.yml"
end
我了解该错误,但看不到在哪里进行更改。我想出了:set端口,可以处理它。
I understand the error, but can't see where to make the change. I figured :set port, would handle it.
推荐答案
您是否尝试过将端口放入存储库路径?类似于 ssh://user@domain.com:9728 / git / appname.git
Have you tried putting the port in your repository path ? Something like ssh://user@domain.com:9728/git/appname.git
我认为Capistrano仅使用您在 set:port
中指定的端口登录远程服务器。
I think Capistrano only uses the port you specify in set :port
to log in your remote servers.
这篇关于Rails,Slicehost,Capistrano-部署端口问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文