为什么 Capistrano 2 在 cap deploy:setup 成功后拒绝 cap deploy:cold ?

发布于 2024-10-09 14:37:31 字数 2071 浏览 0 评论 0原文

我正在尝试使用 Capistrano (2.5.19) 部署 Rails3 应用程序。我已成功运行:

cap deploy:setup

并且在服务器上创建了正确的目录。但是当我运行 capDeploy:cold 或 capdeploy 时,脚本会中途挂起。

    shell$ cap deploy:cold
  * executing `deploy:cold'
  * executing `deploy:update'
 ** transaction: start
  * executing `deploy:update_code'
    executing locally: "git ls-remote [email protected]:test.git master"
  * executing "git clone -q [email protected]: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, "[email protected]:test.git"
    set :branch, "master"
    set :git_enable_submodules, 1

我相信我的文件权限设置正确

I am trying to deploy a Rails3 app with Capistrano (2.5.19). I have successfully run:

cap deploy:setup

and the correct directories were created on the server. But when I run cap deploy:cold or cap deploy the script hangs halfway through.

    shell$ cap deploy:cold
  * executing `deploy:cold'
  * executing `deploy:update'
 ** transaction: start
  * executing `deploy:update_code'
    executing locally: "git ls-remote [email protected]:test.git master"
  * executing "git clone -q [email protected]: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

Here is my 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, "[email protected]:test.git"
    set :branch, "master"
    set :git_enable_submodules, 1

I believe my file permissions are setup correctly

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

梦在夏天 2024-10-16 14:37:32

至少从 1.6.5 开始,JRuby 中似乎存在一个错误 - 请参阅 SSH 代理转发不起作用使用 jRuby(这会让 capistrano ssh 部署失败)

显然,一种“解决方法”是不使用 SSH 代理转发,尽管这可能不可接受。如果您希望更快地注意到并解决该问题(我知道我是这样做的),查看该问题可能会有所帮助。

There appears to be a bug in JRuby since at least 1.6.5 -- see SSH Agent forwarding does not work with jRuby (which lets capistrano ssh-deployments fail)

Apparently one "workaround" is to not use SSH agent forwarding, though that may not be acceptable. If you want the issue noticed and fixed faster (I know I do), watching the issue might help.

厌味 2024-10-16 14:37:32

看起来您无法在 jruby 下运行 Capistrano,因为 jruby-openssl 不支持 Capistrano 底层的 Net:SSH

http://jruby-extras.rubyforge.org/jruby-openssl/

Looks like you can't run Capistrano under jruby, as jruby-openssl doesn't support Net:SSH which underlies Capistrano.

http://jruby-extras.rubyforge.org/jruby-openssl/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文