如何解决“/usr/bin/env: ruby_executable_hooks: No such file or directory”?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/26247926/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to solve "/usr/bin/env: ruby_executable_hooks: No such file or directory"?
提问by Nan Ma
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:
我只是在 vps 中部署 jekyll,并在其上配置 git post-receive hook。当我从笔记本电脑将博客更新推送到 vps 时,我遇到了以下错误:
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:
搜索了一会,尝试了这篇文章中提出的方法:bundle update: env: ruby_executable_hooks: No such file or directory,即执行如下命令:
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?
但这没有帮助,错误仍然存在。由于我不熟悉 rvm 或 ruby,有人能给我一个提示吗?
回答by mpapis
use wrappers, example:
使用包装器,例如:
$ which jekyll
# /path/to/rvm/gems/ruby-version/bin/jekyll
in the returned path replace binwith wrappersso you get:
在返回的路径中替换bin为wrappers:
/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.
这是一个脚本,它将加载适当的环境并解决您的问题,使用 RVM 自动生成包装器。
回答by Yas T.
You need to refresh the executable-hooksto the latest version by running following command in the Terminal:
您需要executable-hooks通过在 中运行以下命令将 刷新到最新版本Terminal:
sudo gem install --user-install executable-hooks
sudo gem install --user-install executable-hooks
回答by PJSCopeland
I had the same problem, but I have bundler, not rubygems-bundler, and my gemdoesn't recognise regenerate_binstubs.
我有同样的问题,但我有bundler,没有rubygems-bundler,而且我gem不认识regenerate_binstubs.
rvm all-gemsets do gem update bundlerinstalled bundler 1.7.11 and fixed it for me.
rvm all-gemsets do gem update bundler安装了 bundler 1.7.11 并为我修复了它。
回答by cjjenkinson
Updating ruby gems worked for me
更新红宝石宝石对我有用
gem install rubygems-update
update_rubygems

