executable-hooks icon indicating copy to clipboard operation
executable-hooks copied to clipboard

ruby_executable_hooks: No such file or directory

Open vuvanly opened this issue 11 years ago • 31 comments

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 [email protected]:arcane-inlet-3324.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to '[email protected]: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

vuvanly avatar Jun 06 '14 15:06 vuvanly

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

mpapis avatar Jun 06 '14 16:06 mpapis

ya, i try with rbenv rehash but nothing happen.

vuvanly avatar Jun 06 '14 16:06 vuvanly

can you show me whole script?

mpapis avatar Jun 06 '14 16:06 mpapis

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 [email protected]:sheltered-headland-3073.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to '[email protected]:sheltered-headland-3073.git'

vuvanly avatar Jun 06 '14 16:06 vuvanly

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

mpapis avatar Jun 06 '14 16:06 mpapis

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

vuvanly avatar Jun 06 '14 16:06 vuvanly

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?

mpapis avatar Jun 06 '14 16:06 mpapis

+1 Same issue for me.

damian-m-g avatar Jun 12 '14 01:06 damian-m-g

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

mpapis avatar Jun 12 '14 07:06 mpapis

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.

damian-m-g avatar Jun 12 '14 09:06 damian-m-g

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.

hone avatar Jun 12 '14 17:06 hone

@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

mpapis avatar Jun 12 '14 17:06 mpapis

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 [email protected] 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 https://github.com/mpapis/executable-hooks/issues/17#issuecomment-45921041 .

hone avatar Jun 12 '14 17:06 hone

executable-hooks should not be added to Gemfile

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

mpapis avatar Jun 12 '14 17:06 mpapis

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

On Thu, Jun 12, 2014 at 12:35 PM, Michal Papis [email protected] 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 https://github.com/mpapis/executable-hooks/issues/17#issuecomment-45923194 .

hone avatar Jun 12 '14 17:06 hone

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)

mpapis avatar Jun 12 '14 17:06 mpapis

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 [email protected] 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 https://github.com/mpapis/executable-hooks/issues/17#issuecomment-45924564 .

hone avatar Jun 12 '14 17:06 hone

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

mpapis avatar Jun 12 '14 18:06 mpapis

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 [email protected] 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 https://github.com/mpapis/executable-hooks/issues/17#issuecomment-45932322 .

hone avatar Jun 12 '14 19:06 hone

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

mpapis avatar Jun 12 '14 20:06 mpapis

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?

damian-m-g avatar Jun 13 '14 22:06 damian-m-g

@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 ....

mpapis avatar Jun 13 '14 22:06 mpapis

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"

vuvanly avatar Jun 15 '14 17:06 vuvanly

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 avatar Jun 16 '14 22:06 mpapis

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 avatar Jul 20 '14 23:07 mpapis

+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.

WaqarHassan avatar Sep 21 '17 15:09 WaqarHassan

can you show me first line of bin/rails?

mpapis avatar Sep 21 '17 22:09 mpapis

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 avatar Sep 22 '17 09:09 WaqarHassan

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...

WaqarHassan avatar Sep 22 '17 09:09 WaqarHassan

Is this still valid or we can close it?

pkuczynski avatar Jan 06 '21 21:01 pkuczynski