heroku-buildpack-ruby: Error running rake or release tasks `ruby: bad interpreter: No such file or directory`

It works on https://github.com/heroku/heroku-buildpack-ruby.git#v215. The app is soon to be retired, so locking down the deploy stack is fine for us, but this could be an issue for others.

On master we get an error like:

remote: -----> Detecting rake tasks        
 
remote:         
 
remote:  !        
 
remote:  !     Could not detect rake tasks        
 
remote:  !     ensure you can run `$ bundle exec rake -P` against your app        
 
remote:  !     and using the production group of your Gemfile.        
 
remote:  !     bash: /tmp/build_FOO/bin/rake: /app/vendor/ruby-2.3.8/bin/ruby: bad interpreter: No such file or directory        
 
remote:  !        

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 24 (18 by maintainers)

Commits related to this issue

Most upvoted comments

Looking into the issue more it seems that the problem is limited to Ruby 2.2 and Ruby 2.3 2.4 binaries. I’m going to write some tooling to verify this is true. If that’s the case then the best solution will be to re-compile which won’t require a buildpack change.

Edit: Turns out it.s Ruby 2.3 and 2.4. You can see a list below in another of my comments.

Does this mean we can go back to heroku/ruby for our ruby buildpack?

Correct. I’ve rolled this out on Monday and I’ve not gotten a single support ticke about it. Everything looks stable.

I just wanted to jump in here. I’m also having the exact same error as @joakimk when trying to deploy to Heroku using the default buildpack release. Also on a Ruby 2.3.8 application.

UPDATE: Manually using the v215 tag for this repo for the ruby buildpack works around the bug.

Hi all, also wanted to jump in and say that I’m having the exact same error with v216. My app is using Ruby 2.4.9. I can confirm that manually setting v215 works around the issue for now. https://github.com/heroku/heroku-buildpack-ruby.git#v215

It looks like my change doesn’t play well with certain versions of Ruby 2.6. I recommend people upgrade to 2.6.6 if they’re getting this failure mode:

 !     /tmp/build_<dir>/vendor/bundle/ruby/2.6.0/gems/bundler-1.17.3/lib/bundler/runtime.rb:319:in `check_for_activated_spec!': You have already activated bundler 1.17.3, but your Gemfile requires bundler 1.17.2. Prepending `bundle exec` to your command may solve this. (Gem::LoadError)

@joakimk it looks like your issue is different since you’re using an older version of Ruby. Are you able to open a ticket? I would like to investigate your failure mode.