Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

/usr/bin/env: ‘ruby_executable_hooks’: No such file or directory on Heroku after removing this gem #65

Open
schneems opened this issue Jan 24, 2019 · 0 comments

Comments

@schneems
Copy link

Hello 👋 . When someone has this gem in their Gemfile, and they push to Heroku it causes executables to be generated with this shebang line:

#!/usr/bin/env ruby_executable_hooks
#
# This file was generated by RubyGems.
#
# The application 'ZenTest' is installed as part of a gem, and
# this file is here to facilitate running it.

The gems are cached between builds. If the application later removes the rubygems-bundler gem then they will get this error:

-----> Ruby app detected
-----> Compiling Ruby/Rails
-----> Using Ruby version: ruby-2.4.5
-----> Installing dependencies using bundler 1.15.2
       Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
       /usr/bin/env: ‘ruby_executable_hooks’: No such file or directory
       Bundler Output: /usr/bin/env: ‘ruby_executable_hooks’: No such file or directory
 !
 !     Failed to install gems via Bundler.
 !
 !     Push rejected, failed to compile Ruby app.
 !     Push failed

I'm not sure if there's any kind of a technical way to solve this issue, however I wanted to document this failure mode so others might find it.

The solution is to clear the build cache on Heroku, this can be done by changing the Ruby version or manually via https://github.com/heroku/heroku-repo through the heroku repo:purge_cache command. Note though that this will also clear older asset versions as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant