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

RubyGitRvmJekyll

Ruby Problem Overview


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: https://stackoverflow.com/questions/18936933/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?

Ruby Solutions


Solution 1 - Ruby

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.

Solution 2 - Ruby

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

Solution 3 - Ruby

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.

Solution 4 - Ruby

Updating ruby gems worked for me

gem install rubygems-update
update_rubygems

Solution 5 - Ruby

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

sudo gem install fastlane -NV

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionNan MaView Question on Stackoverflow
Solution 1 - RubympapisView Answer on Stackoverflow
Solution 2 - RubyYas TabasamView Answer on Stackoverflow
Solution 3 - RubyPJSCopelandView Answer on Stackoverflow
Solution 4 - RubycjjenkinsonView Answer on Stackoverflow
Solution 5 - RubyJayxiangView Answer on Stackoverflow