How do I manage bundled gems in a capistrano deployment?

…衆ロ難τιáo~ 提交于 2020-02-01 04:55:06

问题


Currently, I'm just running the following:

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

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:


Things have changed after the release of bundler 1.0

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

just use require 'bundler/capistrano'

take a look at this http://blog.josephholsten.com/2010/09/deploying-with-bundler-and-capistrano/ for more details



来源:https://stackoverflow.com/questions/4808891/how-do-i-manage-bundled-gems-in-a-capistrano-deployment

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!