Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #23 from heroku/remove_vendor_bundle

Remove `vendor/bundle` if it already exists. Fixes #21.
  • Loading branch information...
commit d3e05848e6959dd31b556f768569e45ed7966b72 2 parents 732674b + 72d6231
@hone hone authored
Showing with 17 additions and 2 deletions.
  1. +17 −2 lib/language_pack/ruby.rb
View
19 lib/language_pack/ruby.rb
@@ -48,6 +48,7 @@ def compile
install_ruby
setup_language_pack_environment
allow_git do
+ remove_vendor_bundle
install_language_pack_gems
build_bundler
create_database_yml
@@ -289,6 +290,20 @@ def install_libyaml(dir)
end
end
+ # remove `vendor/bundle` that comes from the git repo
+ # in case there are native ext.
+ # users should be using `bundle pack` instead.
+ # https://github.com/heroku/heroku-buildpack-ruby/issues/21
+ def remove_vendor_bundle
+ if File.exists?("vendor/bundle")
+ topic "WARNING: Removing `vendor/bundle`."
+ puts "Checking in `vendor/bundle` is not supported. Please remove this directory"
+ puts "and add it to your .gitignore. To vendor your gems with Bundler, use"
+ puts "`bundle pack` instead."
+ FileUtils.rm_rf("vendor/bundle")
+ end
+ end
+
# runs bundler to install the dependencies
def build_bundler
log("bundle") do
@@ -308,11 +323,11 @@ def build_bundler
cache_load ".bundle"
end
- cache_load "vendor/bundle"
-
version = run("env RUBYOPT=\"#{syck_hack}\" bundle version").strip
topic("Installing dependencies using #{version}")
+ cache_load "vendor/bundle"
+
bundler_output = ""
Dir.mktmpdir("libyaml-") do |tmpdir|
libyaml_dir = "#{tmpdir}/#{LIBYAML_PATH}"
Please sign in to comment.
Something went wrong with that request. Please try again.