我的Gemfile中有以下定制炼油厂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

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

有人有任何想法吗?

谢谢,克雷格

有帮助吗?

解决方案

这似乎是邦德勒的问题。文档说,邦德勒应该从Gemfile所在的目录中运行,但是情况并非如此。我解决了这一点是创建自己的捆绑任务,并在运行捆绑包之前明确更改目录。

改变你的 #require 'bundler/capistrano' 在您的deploy.rb文件中对此

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
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top