我正在尝试使用Capistrano(2.5.19)部署Rails3应用程序。我已成功运行:
cap deploy:setup
并在服务器上创建了正确的目录。但是当我运行cap deploy:cold或cap deploy时,脚本会挂起一半。
shell$ cap deploy:cold
* executing `deploy:cold'
* executing `deploy:update'
** transaction: start
* executing `deploy:update_code'
executing locally: "git ls-remote git@server.foo.com:test.git master"
* executing "git clone -q git@server.foo.com:test.git /home/deployer/www/apps/test/releases/20101223162936 && cd /home/deployer/www/apps/test/releases/20101223162936 && git checkout -q -b deploy be3165b74d52540742873c125fb85d04e1ee3063 && git submodule -q init && git submodule -q sync && git submodule -q update && (echo be3165b74d52540742873c125fb85d04e1ee3063 > /home/deployer/www/apps/test/releases/20101223162936/REVISION)"
servers: ["server.foo.com"]
[server.foo.com] executing command
这是我的deploy.rb:
$:.unshift(File.expand_path("~/.rvm/lib"))
require 'rvm/capistrano'
set :rvm_ruby_string, 'jruby'
# main details
set :application, "test_sqlserver"
role :web, "server.foo.com"
role :app, "server.foo.com"
role :db, "server.foo.com", :primary => true
# server details
default_run_options[:pty] = true
ssh_options[:forward_agent] = true
set :deploy_to, "/home/deployer/www/apps/#{application}"
set :deploy_via, :checkout
set :user, :deployer
set :use_sudo, false
# repo details
set :scm, :git
set :repository, "git@server.foo.com:test.git"
set :branch, "master"
set :git_enable_submodules, 1
我相信我的文件权限设置正确
答案 0 :(得分:1)
JRuby似乎有一个错误,因为至少1.6.5 - 见SSH Agent forwarding does not work with jRuby (which lets capistrano ssh-deployments fail)
显然,一种“解决方法”是不使用SSH代理转发,但这可能是不可接受的。如果您希望问题得到注意并加快修复(我知道我这样做),那么观看问题可能有所帮助。
答案 1 :(得分:0)
看起来你不能在jruby下运行Capistrano,因为jruby-openssl不支持Capistrano的基础Net:SSH
。