本文介绍了如何解决“/ usr / bin / env:ruby_executable_hooks:没有这样的文件或目录”?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是在vps中部署jekyll,并在其上配置git post-receive hook。当我从我的笔记本电脑上将博客更新推送到vps时,我遇到了以下错误:

  remote:/ usr / bin / env: ruby_executable_hooks:没有这样的文件或目录

我搜索了一段时间,并尝试了这篇文章中提出的方法:,即执行以下命令:

  rvm @global do gem regenerate_binstubs 
gem regenerate_binstubs

但它没有帮助,错误仍然存​​在。由于我对rvm或ruby不熟悉,任何人都可以给我一个提示吗?

解决方案
使用包装,例如:

p>

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

在返回的路径中用 bin >包装所以你得到:

  / path / to / rvm / gems / ruby​​-version /包装/ jekyll 

这是一个脚本,可以加载适当的环境并解决问题,包装会自动生成使用RVM。

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?

解决方案

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.

这篇关于如何解决“/ usr / bin / env:ruby_executable_hooks:没有这样的文件或目录”?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-03 19:17