Search code examples
gitruby-on-rails-4heroku

Buildpack fails after migrating to Ruby 2.2.0/Rails 4.2


I've been using a custom buildpack on Heroku for some time and had been using the BUILDPACK_URL env variable to kick it off during a push.

Recently I bit the bullet and upgraded from Ruby 1.9.3 / Rails 3.2.14 to Ruby 2.2.0 / Rails 4.2.1.rc1 - everything works fine on my development machine, however I am unable to push to Heroku now, and am getting the following error:

~/documents/coding/test$ heroku fork -a vfacelift vupgrade
~/documents/coding/test$ heroku config:unset BUILDPACK_URL -a vupgrade
~/documents/coding/test$ heroku buildpack:set https://github.com/tomwolfe/heroku-buildpack-gsl-ruby.git -a vupgrade
~/documents/coding/test$ git push vupgrade vupgrade:master
Fetching repository, done.
Counting objects: 9723, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (4943/4943), done.
Writing objects: 100% (9723/9723), 82.88 MiB | 758.00 KiB/s, done.
Total 9723 (delta 6948), reused 6422 (delta 4535)

-----> Fetching custom git buildpack... done
-----> Ruby app detected
-----> Compiling Ruby/Rails
 !
 !     Command: 'set -o pipefail; curl --fail --retry 3 --retry-delay 1 --connect-timeout 3 --max-time 30 https://s3-external-1.amazonaws.com/heroku-buildpack-ruby/ruby-2.2.0.tgz -s -o - | tar zxf -' failed unexpectedly:
 !     
 !     gzip: stdin: unexpected end of file
 !     tar: Child returned status 1
 !     tar: Exiting with failure status due to previous errors
 !

 !     Push rejected, failed to compile Ruby app

To git@heroku.com:vupgrade.git
 ! [remote rejected] upgrade -> master (pre-receive hook declined)
error: failed to push some refs to 'git@heroku.com:vupgrade.git'

Based on other SO answers, I first unset the BUILDPACK_URL env variable from the forked version and used the heroku buildpack:set CLI command. I also tried setting the STACK env variable to cedar-14 but that didn't seem to make a difference.

Since the buildpack has worked fine for some time and was updated for Rails 4, I doubt the issue lies there.

I also tried using the https://github.com/ddollar/heroku-buildpack-multi.git buildpack and included the .buildpacks file with the following:

https://github.com/tomwolfe/heroku-buildpack-gsl-ruby.git
https://github.com/heroku/heroku-buildpack-ruby.git

And then I tried removing buildpack-ruby from the .buildpacks file as I noticed that Heroku was detecting the app as Ruby anyway through the Gemfile. Both of these failed as before.

Any help is much appreciated...

Thanks, Robert


Solution

  • It appears that the directory structure has changed on AWS where heroku is storing their buildpacks. See https://github.com/heroku/heroku-buildpack-ruby/issues/304 for more info. I forked the https://github.com/tomwolfe/heroku-buildpack-gsl-ruby.git buildpack, added STACK to the ruby URL, allowing buildpack users to set it to cedar or cedar-14 or etc and then created a pull request on the master.