【问题标题】:Problem deploying Refinery CMS with Capistrano使用 Capistrano 部署 Refinery CMS 时出现问题
【发布时间】:2010-11-09 02:04:57
【问题描述】:

我的 gemfile 中有以下自定义 Refinery CMS 引擎:

gem 'refinerycms-venues', '1.0', :path => 'vendor/engines', :require => 'venues'
gem 'refinerycms-events', '1.0', :path => 'vendor/engines', :require => 'events'
gem 'refinerycms-available_spaces', '1.0', :path => 'vendor/engines', :require => 'available_spaces'

如果我把这些拿出来,capistrano 部署得很好。但是,如果我让它们像生病的狗一样留在 capistrano pukes 中:

 * executing "bundle install --gemfile /home/some_user/our-website.com/releases/20101109020214/Gemfile --path /home/some_user/our-website.com/shared/bundle --deployment --quiet --without development test engines"
    servers: ["our-website.com"]
    [our-website.com] executing command
 ** [out :: our-website.com] The path `/home/some_user/vendor/engines` does not exist.
    command finished
*** [deploy:update_code] rolling back
  * executing "rm -rf /home/some_user/our-website.com/releases/20101109020214; true"
    servers: ["our-website.com"]
    [our-website.com] executing command
    command finished
failed: "sh -c 'bundle install --gemfile /home/some_user/our-website.com/releases/20101109020214/Gemfile --path /home/some_user/our-website.com/shared/bundle --deployment --quiet --without development test engines'" on our-website.com

它就像看到那些供应商/引擎并认为出于某种原因需要安装它们。我还没有弄清楚如何排除它们。我试图将它们分组,但应用程序无法运行。

有人有什么想法吗?

谢谢, 克雷格

【问题讨论】:

    标签: ruby-on-rails capistrano bundler refinerycms


    【解决方案1】:

    这似乎是捆绑程序的问题。文档说捆绑器应该从 Gemfile 所在的目录运行,但情况似乎并非如此。我解决了创建自己的捆绑任务并在运行捆绑之前显式更改目录的问题。

    在 deploy.rb 文件中将您的 #require 'bundler/capistrano' 更改为此

    after 'deploy:update_code' do
      bundle_cmd     = fetch(:bundle_cmd, "bundle")
      bundle_flags   = fetch(:bundle_flags, "--deployment --quiet")
      bundle_dir     = fetch(:bundle_dir, File.join(fetch(:shared_path), 'bundle'))
      bundle_gemfile = fetch(:bundle_gemfile, "Gemfile")
      bundle_without = [*fetch(:bundle_without, [:development, :test])].compact
    
      args = ["--gemfile #{File.join(fetch(:current_release), bundle_gemfile)}"]
      args << "--path #{bundle_dir}" unless bundle_dir.to_s.empty?
      args << bundle_flags.to_s
      args << "--without #{bundle_without.join(" ")}" unless bundle_without.empty?
    
    
      run_cmd = "cd \"#{fetch(:current_release)}\"; "
      run_cmd << "#{bundle_cmd} install #{args.join(' ')}"
    
      run run_cmd, :shell => '/bin/bash'
    end
    

    【讨论】:

      猜你喜欢
      • 2012-04-13
      • 2012-03-22
      • 2014-07-07
      • 2014-05-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多