Skip to content
This repository has been archived by the owner on Jul 16, 2020. It is now read-only.

Commit

Permalink
Remove cache load for .bundle/config
Browse files Browse the repository at this point in the history
This is a medium-term fix that will resolve a bug in the way Bundler
reads config data.

rubygems/bundler#3261
  • Loading branch information
rpdillon committed Nov 19, 2014
1 parent 33f2e18 commit 4d55cae
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 3 deletions.
30 changes: 28 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,34 @@
Heroku buildpack: Ruby
======================

This is a [Heroku buildpack](http://devcenter.heroku.com/articles/buildpacks) for Ruby, Rack, and Rails apps. It uses [Bundler](http://gembundler.com) for dependency management.
This is a fork of the
[Heroku buildpack](http://devcenter.heroku.com/articles/buildpacks)
for Ruby, Rack, and Rails apps. It uses
[Bundler](http://gembundler.com) for dependency management.

Why the Fork?
-------------

The reason for this fork is due to a bug in Bundler, which causes the
bundler config to get rewritten on every deploy in such a way that
multi-line environment variables, such as those used by the
heroku-buildpack-rgeo, have the number of quotes in them double. This
leads to 2^n expansion in size of the `.bundle/config` file, so we can
only go for about 25-26 deploys before we can no longer deploy the
app.

The patch for this behavior is to use the `heroku repo` extension and
issue a `heroku repo:purge_cache` directive to reset the state of the
cached `.bundle/config`. A more permanant fix is to modify this
buildpack to not cache the file at all. The 'correct' fix would be to
have Bundler avoid the use of regular expressions to parse YAML for a
small gain in performance.

A minimal example of the bug is in this gist:
https://gist.github.com/rpdillon/8e7c40213e4dabd453b3

The issue with Bundler was reported here:
https://github.com/bundler/bundler/issues/3261

Usage
-----
Expand Down Expand Up @@ -189,4 +216,3 @@ Rails 3 (config/application.rb is detected)
* everything from Rails 2
* install rails 3 plugins
* [rails3_server_static_assets](https://github.com/pedro/rails3_serve_static_assets)

2 changes: 1 addition & 1 deletion lib/language_pack/ruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ def build_bundler
else
# using --deployment is preferred if we can
bundle_command += " --deployment"
cache.load ".bundle"
# cache.load ".bundle"
end

topic("Installing dependencies using #{bundler.version}")
Expand Down

0 comments on commit 4d55cae

Please sign in to comment.