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

ruby_executable_hooks: No such file or directory #17

Open
vuvanly opened this issue Jun 6, 2014 · 31 comments
Open

ruby_executable_hooks: No such file or directory #17

vuvanly opened this issue Jun 6, 2014 · 31 comments

Comments

@vuvanly
Copy link

vuvanly commented Jun 6, 2014

Hi everyone,
When i try to deploy app to heroku i got this error

charitys-MacBook-Pro:bus_tracking charity$ git push heroku master 
Fetching repository, done.
Counting objects: 13, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (10/10), done.
Writing objects: 100% (10/10), 3.90 KiB | 0 bytes/s, done.
Total 10 (delta 4), reused 0 (delta 0)

-----> Ruby app detected
-----> Compiling Ruby/Rails
-----> Using Ruby version: ruby-2.1.1
-----> Installing dependencies using 1.5.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

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

I followed @mpapis but i still not work. Please help me.

charitys-MacBook-Pro:bus_tracking charity$ gem install executable-hooks -v ">=1.3.2" 
Building native extensions.  This could take a while...
# In case of problems run the following command to update binstubs:
gem regenerate_binstubs
Successfully installed executable-hooks-1.3.2
Parsing documentation for executable-hooks-1.3.2
Done installing documentation for executable-hooks after 0 seconds
1 gem installed
charitys-MacBook-Pro:bus_tracking charity$ gem regenerate_binstubs
try also: gem pristine --binstubs
airbrake 3.1.16
airbrake 3.1.15
annotate 2.6.3
annotate 2.6.2
aws-sdk 1.38.0
aws-sdk 1.34.1
bourbon 4.0.1
bourbon 4.0.0
bourbon 3.1.8
brakeman 2.0.0
bundler 1.6.2
coderay 1.1.0
compass 1.0.0.alpha.19
debugger 1.6.6
delayed_job_web 1.2.9
delayed_job_web 1.2.8
delayed_job_web 1.2.5
diff-lcs 1.2.5
engineyard 2.3.3
engineyard 2.3.2
erubis 2.7.0
executable-hooks 1.3.2
executable-hooks 1.3.1
ey_config 0.0.7
ey_config 0.0.6
haml 4.1.0.beta.1
html2haml 1.0.1
httpclient 2.3.4.1
launchy 2.4.2
newrelic_rpm 3.7.3.204
nokogiri 1.6.1
premailer 1.8.2
premailer 1.8.0
pry 0.9.12.6
rack 1.5.2
railroad 0.5.0
rails-erd 1.1.0
railties 4.1.0
railties 4.0.4
railties 4.0.3
rake 10.3.1
rake 10.3.0
rake 10.2.2
rake 10.1.1
rake 10.1.0
rdoc 4.1.1
rdoc 4.1.0
rest-client 1.6.7
rest_client 1.7.3
rspec-core 2.14.8
rspec-core 2.14.7
ruby-graphviz 1.0.9
ruby2ruby 2.0.8
ruby_parser 3.1.3
safe_yaml 1.0.3
sass 3.3.8
sass 3.3.7
sass 3.3.5
sass 3.2.19
sass 3.2.14
sdoc 0.4.0
sidekiq 3.0.0
slim 1.3.9
spork 1.0.0rc4
spring 1.1.3
spring 1.1.2
sprockets 2.12.1
sprockets 2.12.0
sprockets 2.11.0
thin 1.6.2
thin 1.6.1
thor 0.19.1
thor 0.18.1
tilt 1.4.1
treetop 1.4.15
unicorn 4.8.2

@mpapis
Copy link
Member

mpapis commented Jun 6, 2014

wen using rbenv you need to also run rbenv rehash - do you have it in the script you use in git hook?

@vuvanly
Copy link
Author

vuvanly commented Jun 6, 2014

ya, i try with rbenv rehash but nothing happen.

@mpapis
Copy link
Member

mpapis commented Jun 6, 2014

can you show me whole script?

@vuvanly
Copy link
Author

vuvanly commented Jun 6, 2014

yeah, it is:

charitys-MacBook-Pro:bus_tracking charity$ gem install executable-hooks -v ">=1.3.2" 
Building native extensions.  This could take a while...
# In case of problems run the following command to update binstubs:
gem regenerate_binstubs
Successfully installed executable-hooks-1.3.2
Parsing documentation for executable-hooks-1.3.2
Done installing documentation for executable-hooks after 3 seconds
1 gem installed
charitys-MacBook-Pro:bus_tracking charity$ gem regenerate_binstubs
try also: gem pristine --binstubs
airbrake 3.1.16
airbrake 3.1.15
annotate 2.6.3
annotate 2.6.2
aws-sdk 1.38.0
aws-sdk 1.34.1
bourbon 4.0.1
bourbon 4.0.0
bourbon 3.1.8
brakeman 2.5.0
brakeman 2.0.0
bundler 1.6.2
coderay 1.1.0
compass 1.0.0.alpha.19
debugger 1.6.8
debugger 1.6.6
delayed_job_web 1.2.9
delayed_job_web 1.2.8
delayed_job_web 1.2.5
diff-lcs 1.2.5
engineyard 2.3.3
engineyard 2.3.2
erubis 2.7.0
executable-hooks 1.3.2
executable-hooks 1.3.1
ey_config 0.0.7
ey_config 0.0.6
haml 4.1.0.beta.1
haml 4.0.5
html2haml 1.0.1
httpclient 2.3.4.1
launchy 2.4.2
newrelic_rpm 3.7.3.204
nokogiri 1.6.2.1
nokogiri 1.6.1
premailer 1.8.2
premailer 1.8.0
pry 0.9.12.6
rack 1.5.2
railroad 0.5.0
rails-erd 1.1.0
railties 4.1.0
railties 4.0.4
railties 4.0.3
rake 10.3.2
rake 10.3.1
rake 10.3.0
rake 10.2.2
rake 10.1.1
rake 10.1.0
rdoc 4.1.1
rdoc 4.1.0
rest-client 1.6.7
rest_client 1.7.3
rspec-core 3.0.0
rspec-core 2.14.8
rspec-core 2.14.7
ruby-graphviz 1.0.9
ruby2ruby 2.0.8
ruby_parser 3.4.1
ruby_parser 3.1.3
safe_yaml 1.0.3
sass 3.3.8
sass 3.3.7
sass 3.3.5
sass 3.2.19
sass 3.2.14
sdoc 0.4.0
sidekiq 3.0.0
slim 2.0.2
slim 1.3.9
spork 1.0.0rc4
spring 1.1.3
spring 1.1.2
sprockets 2.12.1
sprockets 2.12.0
sprockets 2.11.0
thin 1.6.2
thin 1.6.1
thor 0.19.1
thor 0.18.1
tilt 1.4.1
treetop 1.4.15
unicorn 4.8.2
charitys-MacBook-Pro:bus_tracking charity$ gem pristine --binstubs
ERROR:  While executing gem ... (OptionParser::InvalidOption)
    invalid option: --binstubs
charitys-MacBook-Pro:bus_tracking charity$ rbenv rehash
charitys-MacBook-Pro:bus_tracking charity$ git push heroku master 
Fetching repository, done.
Counting objects: 5, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 670 bytes | 0 bytes/s, done.
Total 3 (delta 2), reused 0 (delta 0)

-----> Fetching custom git buildpack... done
-----> Ruby app detected
-----> Compiling Ruby/Rails
-----> Using Ruby version: ruby-2.1.1
-----> Installing dependencies using 1.5.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

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

@mpapis
Copy link
Member

mpapis commented Jun 6, 2014

the error happens inside of git push heroku master - there is a git ook whic calls some ruby/gem commands - it's the problem, not what you run locally

@vuvanly
Copy link
Author

vuvanly commented Jun 6, 2014

ya, i got it. so can you help me with this error, i Google alot but no result.

@mpapis
Copy link
Member

mpapis commented Jun 6, 2014

I can not help you any more without seeing the code that you execute in the hook, if you have no control over the script (because heroku) - ten you should contact them about the script ... maybe @hone could help us here?

@damian-m-g
Copy link

+1 Same issue for me.

@mpapis
Copy link
Member

mpapis commented Jun 12, 2014

@IgorJorobus please reread the ticket and try to provide the required information

@damian-m-g
Copy link

I'm sorry mpapis, yesterday was a bit confused, it's nothing about your proyect. Seems that's a heroku issue, google "Bundler Output: /usr/bin/env: ruby_executable_hooks: No such file or directory" . Same log in the console when I try to upload my project to heroku. When I upload for the first time my app to a heroku subdomain works great, but then, when you want to push your project again the issue arise. I'm working on Windows 7 OS, ruby 2.0, rails 4.1.1.

@hone
Copy link

hone commented Jun 12, 2014

I'm not familiar with ruby_executable_hooks. Can you file a support ticket at <help.heroku.com>. Also, any code that can be provided to help reproduce the issue would helpful.

@mpapis
Copy link
Member

mpapis commented Jun 12, 2014

@hone https://github.com/mpapis/executable-hooks/blob/master/bin/ruby_executable_hooks and it is installed via https://github.com/mpapis/executable-hooks/blob/master/lib/executable-hooks/wrapper.rb#L8-L23 (Gem.configuration[:custom_shebang] = "$env ruby_executable_hooks") this way all gem binaries have a header #!/usr/bin/env ruby_executable_hooks - and this way they can automatically load bundler when needed

@hone
Copy link

hone commented Jun 12, 2014

That means ruby_executable_hooks is not on the PATH. Does this overwrite
the binstub of bundler itself? That's very bad. If they remove
executable-hooks from their Gemfile, I'm pretty sure it will fix the
issue. They're also need to purge their gem cache, b/c all the binstubs are overwritten.

On Thu, Jun 12, 2014 at 12:17 PM, Michal Papis notifications@github.com
wrote:

@hone https://github.com/hone
https://github.com/mpapis/executable-hooks/blob/master/bin/ruby_executable_hooks
and it is installed via
https://github.com/mpapis/executable-hooks/blob/master/lib/executable-hooks/wrapper.rb#L8-L23
(Gem.configuration[:custom_shebang] = "$env ruby_executable_hooks") this
way all gem binaries have a header #!/usr/bin/env ruby_executable_hooks -
and this way they can automatically load bundler when needed


Reply to this email directly or view it on GitHub
#17 (comment)
.

@mpapis
Copy link
Member

mpapis commented Jun 12, 2014

executable-hooks should not be added to Gemfile

@IgorJorobus, @123lyvv can you confirm that there is no executable-hooks in your Gemfile?

@hone
Copy link

hone commented Jun 12, 2014

Should we be checking for executable-hooks from being installed on Heroku?

On Thu, Jun 12, 2014 at 12:35 PM, Michal Papis notifications@github.com
wrote:

executable-hooks should not be added to Gemfile

@IgorJorobus https://github.com/IgorJorobus, @123lyvv
https://github.com/123lyvv can you confirm that there is no
executable-hooks in your Gemfile?


Reply to this email directly or view it on GitHub
#17 (comment)
.

@mpapis
Copy link
Member

mpapis commented Jun 12, 2014

it can be installed, I would be more interested in seeing what happens and handling the given use case better (either in the script or as an extra fix in the gem)

@hone
Copy link

hone commented Jun 12, 2014

I don't believe there's actually a benefit to installing it on heroku since
we setup the binstubs so you don't need to type bundle exec.

On Thu, Jun 12, 2014 at 12:47 PM, Michal Papis notifications@github.com
wrote:

it can be installed, I would be more interested in seeing what happens and
handling the given use case better (either in the script or as an extra fix
in the gem)


Reply to this email directly or view it on GitHub
#17 (comment)
.

@mpapis
Copy link
Member

mpapis commented Jun 12, 2014

@hone you can ban the gem, but I still would like to know how this happens so I can prevent it for others

@hone
Copy link

hone commented Jun 12, 2014

Sure, I'd be happy to help. Ideally, if it just worked we wouldn't have to
ban it. <3

On Thu, Jun 12, 2014 at 1:48 PM, Michal Papis notifications@github.com
wrote:

@hone https://github.com/hone you can ban the gem, but I still would
like to know how this happens so I can prevent it for others


Reply to this email directly or view it on GitHub
#17 (comment)
.

@mpapis
Copy link
Member

mpapis commented Jun 12, 2014

@hone any chance to get the script that gets ran? it would help me to understand the problem.

@damian-m-g
Copy link

Yes mpapis, there is. Was suggested to install by The Ruby Tutorial book so you can call for example rake test without the bundle exec. In fact the gem included in the Gemfile is rubygems-bundler which includes two more, one is the problematic, and another one. Question related: if I install my gems with bundle install --binstubs I'm getting the same result, right?

@mpapis
Copy link
Member

mpapis commented Jun 13, 2014

@IgorJorobus if the gem is in Gemfile and you run bundle install --binstubs - this would be the problem, the gem executable-hooks is installed during but not after the gems are installed, as long, as the gem is not installed, it is not possible to hook rubygems ....

@vuvanly
Copy link
Author

vuvanly commented Jun 15, 2014

executable-hooks gem exists in my gem list but not in Gemfile, somehow it's automatically install. @mpapis @hone.
what should i do?

this is my Gemfile:

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

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.1.0'
# Use postgresql as the database for Active Record
gem 'rake'
gem 'pg'
gem 'draper'
gem 'rails_admin'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.3'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', '~> 4.0.0'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer',  platforms: :ruby

# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0',          group: :doc

# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
group :development do
  gem 'pry-rails'
  gem 'spring'
end


group :test do
  gem 'rspec'
  gem 'rspec-rails'
  gem 'shoulda-matchers'
  gem 'simplecov'
end

group :test, :development do
  gem 'debugger'
  gem 'faker'
  gem 'brakeman'
end

group :production do
  # Gem for deploy to Heroku
  gem 'rails_12factor'
end
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'

# Use unicorn as the app server
# gem 'unicorn'

# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development

# Use debugger
# gem 'debugger', group: [:development, :test]

# To fix the problem of double loading Psych
# See: https://github.com/thoughtbot/laptop/pull/70
gem "rubygems-bundler", "~> 1.4.2"

@mpapis
Copy link
Member

mpapis commented Jun 16, 2014

ah there is gem "rubygems-bundler", "~> 1.4.2" I see no connection to the mentioned ticket, remove it and report any problems you find

@mpapis
Copy link
Member

mpapis commented Jul 20, 2014

it has been over month without feedback, closing the ticket, please let me know if you can provide the requested details and I will reopen

@mpapis mpapis closed this as completed Jul 20, 2014
@WaqarHassan
Copy link

WaqarHassan commented Sep 21, 2017

+1 Same for me.
I am deploying a crawler app to heroku. But After spending 5 hours. still not able to resolve it.
Kindly help me.

@mpapis
Copy link
Member

mpapis commented Sep 21, 2017

can you show me first line of bin/rails?

@mpapis mpapis reopened this Sep 21, 2017
@WaqarHassan
Copy link

WaqarHassan commented Sep 22, 2017

Here are all lines.

#!/usr/bin/env ruby
begin
  load File.expand_path('../spring', __FILE__)
rescue LoadError => e
  raise unless e.message.include?('spring')
end
APP_PATH = File.expand_path('../../config/application', __FILE__)
require_relative '../config/boot'
require 'rails/commands'

@WaqarHassan
Copy link

WaqarHassan commented Sep 22, 2017

I updated rails version to 5.0 and ruby 2.3.3. I am able to create and migrate database on heroku but still getting same error while running

heroku run rails db:seed

also when pushing to heroku I get

Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
remote:        /usr/bin/env: ‘ruby_executable_hooks’: No such file or directory
remote:        Bundler Output: /usr/bin/env: ‘ruby_executable_hooks’: No such file or directory
remote:  !
remote:  !     Failed to install gems via Bundler.
remote:  !
remote:  !     Push rejected, failed to compile Ruby app.
remote: 
remote:  !     Push failed
remote: Verifying deploy...

@pkuczynski
Copy link
Member

Is this still valid or we can close it?

@jdempcy
Copy link

jdempcy commented Aug 25, 2022

I'm still getting

/usr/bin/env: ‘ruby_executable_hooks’: No such file or directory

This is following the latest kickoff_tailwind Rails project which is all latest and greatest, up to date 2022 stuff. But it does include executable-hooks which I am guessing is the problem. Will see if I can remove it.

Here is the project that cannot deploy on Heroku right now because of this error:

https://github.com/justalever/kickoff_tailwind

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

No branches or pull requests

7 participants