Christian Schlensker
Christian Schlensker

Reputation: 22478

Bundle fails, undefined method `ruby' when deploying to heroku

I'm trying to deploy a Rack app to heroku and it's failing on the bundle step:

-----> Fetching custom git buildpack... done
-----> Ruby/Rack app detected
-----> Using RUBY_VERSION: ruby-1.9.3-p0
-----> Installing dependencies using Bundler version 1.1.rc.7
   Running: bundle install --without development:test --path vendor/bundle --binstubs bin/ --deployment
   /tmp/build_158s9o0ec0gdk/Gemfile:2:in `evaluate': undefined method `ruby' for #<Bundler::Dsl:0x00000001c7c418> (NoMethodError)
 (...)
   /app/bin/bundle:23:in `load'
   /app/bin/bundle:23:in `<main>'
   There was an error in your Gemfile, and Bundler cannot continue.
!
!     Failed to install gems via Bundler.
!
!     Heroku push rejected, failed to compile Ruby/rack app

The failure is undefined method 'ruby' for #<Bundler::Dsl:0x00000001c7c418> (NoMethodError)

This comes from my Gemfile

source 'https://rubygems.org'
ruby '2.0.0'

I assume it's being caused by the fact that that method wasn't added to Bundler until version 1.2 and heroku seems to be using version 1.1.rc.7.

I don't know how to upgrade the heroku version of bundler. I'm already on the Cedar stack.

Upvotes: 1

Views: 354

Answers (1)

matt
matt

Reputation: 79723

The log says Fetching custom git buildpack – it looks like you’re using a custom buildpack, which might explain why the old version of Bundler is being used.

Does

heroku config:get BUILDPACK_URL

show anything? You might just need to stop using the custom buildpack, try

heroku config:unset BUILDPACK_URL

to clear the config var and revert to the normal buildpack.

Upvotes: 1

Related Questions