How to solve "/usr/bin/env: ruby_executable_hooks: No such file or directory"?
Asked Answered
D

5

75

I just deploy jekyll in a vps, and config git post-receive hook on it. When I push blog update to vps from my laptop, I run into this error:

remote: /usr/bin/env: ruby_executable_hooks: No such file or directory

I searched for a while, and tried the method proposed in this post: bundle update: env: ruby_executable_hooks: No such file or directory, i.e., executing the commands below:

rvm @global do gem regenerate_binstubs
gem regenerate_binstubs

But it doesn't help, the error remains. Since I'm not familiar with rvm or ruby, could anyone give me a hint?

Devoice answered 8/10, 2014 at 1:36 Comment(1)
Just ran into the same issue when pointing Atom to use a correct Rubocop executable. Top solution actually helped. You could probably accept the one you used, by the way :)Hendrix
D
183

use wrappers, example:

$ which jekyll
# /path/to/rvm/gems/ruby-version/bin/jekyll

in the returned path replace bin with wrappers so you get:

/path/to/rvm/gems/ruby-version/wrappers/jekyll

this is a script that will load proper environment and fix your problem, wrappers are generated automatically withing RVM.

Dnieper answered 14/10, 2014 at 21:23 Comment(14)
I have to agree with Dex. Was going round in circles trying to get MailCatcher to play nicely with Vagrant/PHP/Drupal and this was the key. sendmail_path = /usr/bin/env /home/vagrant/.rvm/gems/ruby-1.9.3-p551/wrappers/catchmail. Wrappers instead of bin! thanks.Definition
it works! i was trying to schedule a backup using the backup gem.Cottonade
how do you exactly replace the path ? I guess I should not "delete" bin. I am using Mac. thanksRowdy
it works the same on mac or linux, the path with wrappers includes environment, the path with bin - does not - so it will not know about the rest of gemsDnieper
WOW. Thank you! I cannot believe that this wasn't mentioned anywhere else. For those searching, I was attempting to setup PHPStorm to work with SCSS and needed the path /Users/username/.rvm/gems/ruby-2.2.1/wrappers/scssSharla
This really helped. But @mpapis, using RVM recently seems like bandaid after bandaid. (But maybe rvm1/ansible and Capistrano are more at fault than RVM)Silvestro
the same issue was always there - loading binary without proper environment - the difference is that now you can find out about it early thanks to ruby_executable_hooksDnieper
when I run "which jekyll", I got a blank. What should I do?Skivvy
For me, this helped me get a command running when I wasn't logged in as my usual user. Instead, I am getting a process started up via launchctl and monit on a mac, and this worked. Thanks!Boast
This also resolved an issue with the Atom autocomplete-ruby package, which was giving me the same error when starting Atom.Thematic
I can't thank you enough for this. I spent a whole day trying to get my new deploy setup to work, and this did the trick. Thank you, thank you, thank you.Janssen
Superb. Helped me a lot in setting up resque worker & scheduler using systemdPrecautious
This worked for me but only after another change. Having no jekyll I ran ´which bundle´ which returned similar path starting with ´.rvm/rubies/RUBY-VERSION´. There are no wrappers in that folder. Make sure to replace ´rubies´ with ´gems´!Aristocracy
Spent a lot of time before get to this answer, and it works perfectlyInconvertible
H
30

You need to refresh the executable-hooks to the latest version by running following command in the Terminal:

sudo gem install --user-install executable-hooks

Halpin answered 8/4, 2015 at 15:57 Comment(0)
R
6

I had the same problem, but I have bundler, not rubygems-bundler, and my gem doesn't recognise regenerate_binstubs.

rvm all-gemsets do gem update bundler installed bundler 1.7.11 and fixed it for me.

Rave answered 6/1, 2015 at 23:32 Comment(0)
J
3

Updating ruby gems worked for me

gem install rubygems-update
update_rubygems
Jolynnjon answered 2/10, 2016 at 10:10 Comment(0)
M
0

faslane env: ruby_executable_hooks: No such file or directory
re-install faslane

sudo gem install fastlane -NV
Miracle answered 28/7, 2020 at 3:6 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.