gunpowderlabs / buildpack-ruby-rake-deploy-tasks

Run arbitrary rake tasks on deploy to Heroku
MIT License
146 stars 79 forks source link

Getting a bundler/setup (LoadError) #10

Open chrisnicola opened 8 years ago

chrisnicola commented 8 years ago

This is what I'm seeing when deploying. I'm using Rails 5.0.0.1.

I'm suspecting it may have something to do with the binstubs, but they are the default ones. Nothing special there.

-----> Rake app detected
/tmp/{redacted}/vendor/ruby-2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- bundler/setup (LoadError)
    from /tmp/{redacted}/vendor/ruby-2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /tmp/{redacted}/config/boot.rb:6:in `<top (required)>'
    from bin/rake:2:in `require_relative'
    from bin/rake:2:in `<main>'
 !     Push rejected, failed to compile Rake app.
 !     Push failed
petrgazarov commented 8 years ago

Same, using rails 4.2.7.

Actually, my output is somewhat different (may not be same issue):

-----> Rake app detected
/app/tmp/buildpacks/c72957e2a3a6a40281e4b97afc23d1ba0aaf219f9456d09b2ff23741cb89ea2026349b2adfda30a146b4b2adb05024ad79c04c5ae4975333b55ce131f8dd47c2/bin/compile: line 30: rake: command not found
 !     Push rejected, failed to compile Rake app.
 !     Push failed
psyho commented 8 years ago

Did you remember to set the "base" buildpack? What does the heroku buildpacks command print for your app?

petrgazarov commented 8 years ago

@psyho Yeah, I've got the standard ruby pack first, then I also have a phantomjs pack:

$ heroku buildpacks
=> 1. https://github.com/heroku/heroku-buildpack-ruby.git
2. https://github.com/gunpowderlabs/buildpack-ruby-rake-deploy-tasks.git
3. https://github.com/stomita/heroku-buildpack-phantomjs
psyho commented 8 years ago

@petrgazarov does your Gemfile include a line for rake?

petrgazarov commented 8 years ago

So what's interesting is that, when it first installs the ruby buildpack (since it's first in order), script works fine: bundler is installed, and rake is available. So gems in Gemfile are installed without a problem (there is no line for rake in Gemfile, but I think it's part of the standard ruby buildpack).

When this buildpack is installed next, neither rake nor bundler are installed. When I patch this script to include gem install bundler, it complains that it's a read-only system.

acarpe commented 8 years ago

I solved this same error in this way https://github.com/febeling/webpack-rails-buildpack/pull/5 you can probably do the same for this buildpack