如何在capistrano部署中管理捆绑的gem? [英] How do I manage bundled gems in a capistrano deployment?

查看:49
本文介绍了如何在capistrano部署中管理捆绑的gem?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当前,我正在运行以下命令:

Currently, I'm just running the following:

在'deploy:update_code','deploy:bundle'之后

after 'deploy:update_code', 'deploy:bundle'

namespace :deploy do
  task :bundle do
    run "cd #{release_path} && bundle install --deployment --without development test staging"
  end
end

现在这可以正常工作,但是捆绑器最终每次都将所有gem安装到 vendor / gems 中。虽然我了解了将gem隔离到每个发行版的优点(而不是使用共享文件夹,但使用(?)可能会导致回滚等错误),但是肯定有更好的方法可以避免这种情况

Now this works fine, but the bundler ends up installing all the gems to vendor/gems every time. While I understand the merit in isolating the gems to each release (as opposed to using the shared folder, which (?) might result in errors on rollback and such), surely there is a better way to do this that doesn't take as much time to deploy and saves on disk space.

推荐答案

捆绑程序1.0发行后,情况发生了变化

Things have changed after the release of bundler 1.0

您无需通过部署创建自定义任务。

You don't need to create a custom task from deploy.

只使用需要'bundler / capistrano'

查看此 http://blog.josephholsten。 com / 2010/09 / deploying-withbundler-and-capistrano / 了解更多详情

这篇关于如何在capistrano部署中管理捆绑的gem?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆