Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save artemave/785926 to your computer and use it in GitHub Desktop.

Select an option

Save artemave/785926 to your computer and use it in GitHub Desktop.
desc "Tell app to use local gems and tweak bundler to not break with gems coming from git"
task :enable_local_gems_and_bundler do
run %(perl -pi -e 'print "ENV[\\"GEM_HOME\\"] = \\"/home/#{user}/.gems\\"\\nGem.clear_paths\\n" if $. == 1' #{release_path}/config/application.rb)
run "echo 'BUNDLE_PATH: /home/#{user}/.gems/bundler' >> #{release_path}/.bundle/config"
end
@artemave
Copy link
Copy Markdown
Author

Or, instead of this remarkably efforted hack, one could go with "require 'bundler/capistrano'" in deploy.rb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment