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

Solution 1:

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:

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:

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.