本文介绍了/ usr / bin / env ruby​​_noexec_wrapper失败,没有文件或目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 #service chef-solr start 
启动Chef-solr:/ usr / bin / env:ruby_noexec_wrapper:没有这样的文件或目录
[FAILED]

但是当我从命令行手动运行它运行成功

 #chef-solr -d -c /etc/chef/solr.rb -L ​​/var/log/chef/solr.log -P /var/run/chef/solr.pid 
#echo $?
0
#ps -ef | grep厨师
根2691 1 12 04:19? 00:00:01 java -Xmx256M -Xms256M -Dsolr.data.dir = / var / lib / chef / solr / data -Dsolr.solr.home = / var / lib / chef / solr / home -jar / var / lib /chef/solr/jetty/start.jar

这是我的rvm信息

 #rvm info 

ruby​​-1.9.3-p194:

system:
uname:Linux控制台2.6.32-220.el6.x86_64#1 SMP Wed Nov 9 08:03:13 EST 2011 x86_64 x86_64 x86_64 GNU / Linux
bash:/ bin / bash => GNU bash,版本4.1.2(1)-release(x86_64-redhat-linux-gnu)
zsh:=>未安装

rvm:
版本: rvm 1.15.6(stable)by Wayne E. Seguin< [email protected]> Michal Papis< [email protected]> [https://rvm.io/]
updated: 7小时1分51秒前

ruby​​:
interpreter:ruby
version:1.9.3p194
date:2012-04-20
platform:x86_64-linux
patchlevel:2012-04-20修订35410
full_version:ruby 1.9.3p194(2012-04-20修订35410)[x86_64-linux]

homes:
gem:/ usr / local / rvm /gems/ruby-1.9.3-p194
ruby​​:/usr/local/rvm/rubies/ruby-1.9.3-p194

二进制:
ruby :/ / / / rr /
gem:/usr/local/rvm/rubies/ruby-1.9.3-p194/bin/gem
rake:/usr/local/rvm/gems/ruby-1.9.3 -p194 / bin / rake

环境:
PATH:/usr/local/rvm/gems/ruby-1.9.3-p194/bin:/usr/local/rvm/ gems/ruby-1.9.3-p194@global/bin:/usr/local/rvm/rubies/ruby-1.9.3-p194/bin:在/ usr /本地/ RVM /斌:/usr/lib64/qt-3.3 /斌:在/ usr / java / default文件/ bin中:/ bin中:在/ usr / Kerberos的/ sbin目录:在/ usr / Kerberos的/ bin中:在/ usr / local / sbin中:在/ usr / local / bin目录:/ sbin目录:/ usr / sbin目录:/ usr / bin:/ root / bin
GEM_HOME:/usr/local/rvm/gems/ruby-1.9.3-p194
GEM_PATH:/ usr / local / rvm / gems /ruby-1.9 .3-p194:/usr/local/rvm/gems/ruby-1.9.3-p194@global
MY_RUBY_HOME:/usr/local/rvm/rubies/ruby-1.9.3-p194
IRBRC:/usr/local/rvm/rubies/ruby-1.9.3-p194/.irbrc
RUBYOPT:
gemset:

以下是相应的环境变量

 声明-x GEM_HOME =/ usr / local / rvm / gems / ruby​​-1.9.3-p194
declare -x GEM_PATH =/ usr / local / rvm / gems / ruby​​-1.9.3-p194: /usr/local/rvm/gems/ruby-1.9.3-p194@global
declare -x IRBRC =/ usr / local / rvm / rubies / ruby​​-1.9.3-p194 / .irbrc
declare -x MY_RUBY_HOME =/ usr / local / rvm / rubies / ruby​​-1.9.3-p194
declare -x PATH =/ usr / local / rvm / gems / ruby​​-1.9.3 -p194 /斌:/usr/local/rvm/gems/ruby-1.9.3-p194@global/bin:/usr/local/rvm/rubies/ruby-1.9.3-p194/bin:在/ usr /本地/ RVM /斌:/usr/lib64/qt-3.3/bin:在/ usr / java / default文件/ bin中:/ bin中:在/ usr / Kerberos的/ sbin目录:在/ usr / Kerberos的/ bin中:在/ usr / local / sbin中:在/ usr / local / bin:/ sbin:/ usr / sbin:/ usr / bin:/ root / bin
declare -x RUBY_VERSI ON =ruby-1.9.3-p194

如何解决此问题? >

解决方案

确保所有变量都设置正确,特别是 PATH GEM_PATH ,您可以使用此代码为您设置环境:

 源/ usr / local / rvm / environments / ruby​​-1.9.3-p194 

将其添加到服务中 chef-solr 运行


When I try to start chef-solr as service it's failing with the following error

# service chef-solr start
Starting chef-solr: /usr/bin/env: ruby_noexec_wrapper: No such file or directory
                                                       [FAILED]

But when I run it manually from command line it's running successfully

# chef-solr -d -c /etc/chef/solr.rb -L /var/log/chef/solr.log -P /var/run/chef/solr.pid
# echo $?
0
# ps -ef | grep chef
root      2691     1 12 04:19 ?        00:00:01 java -Xmx256M -Xms256M -Dsolr.data.dir=/var/lib/chef/solr/data -Dsolr.solr.home=/var/lib/chef/solr/home -jar /var/lib/chef/solr/jetty/start.jar

Here is my rvm info

# rvm info

ruby-1.9.3-p194:

  system:
    uname:       "Linux Console 2.6.32-220.el6.x86_64 #1 SMP Wed Nov 9 08:03:13 EST 2011 x86_64 x86_64 x86_64 GNU/Linux"
    bash:        "/bin/bash => GNU bash, version 4.1.2(1)-release (x86_64-redhat-linux-gnu)"
    zsh:         " => not installed"

  rvm:
    version:      "rvm 1.15.6 (stable) by Wayne E. Seguin <[email protected]>, Michal Papis <[email protected]> [https://rvm.io/]"
    updated:      "7 hours 1 minute 51 seconds ago"

  ruby:
    interpreter:  "ruby"
    version:      "1.9.3p194"
    date:         "2012-04-20"
    platform:     "x86_64-linux"
    patchlevel:   "2012-04-20 revision 35410"
    full_version: "ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]"

  homes:
    gem:          "/usr/local/rvm/gems/ruby-1.9.3-p194"
    ruby:         "/usr/local/rvm/rubies/ruby-1.9.3-p194"

  binaries:
    ruby:         "/usr/local/rvm/rubies/ruby-1.9.3-p194/bin/ruby"
    irb:          "/usr/local/rvm/rubies/ruby-1.9.3-p194/bin/irb"
    gem:          "/usr/local/rvm/rubies/ruby-1.9.3-p194/bin/gem"
    rake:         "/usr/local/rvm/gems/ruby-1.9.3-p194/bin/rake"

  environment:
    PATH:         "/usr/local/rvm/gems/ruby-1.9.3-p194/bin:/usr/local/rvm/gems/ruby-1.9.3-p194@global/bin:/usr/local/rvm/rubies/ruby-1.9.3-p194/bin:/usr/local/rvm/bin:/usr/lib64/qt-3.3/bin:/usr/java/default/bin:/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/usr/sbin:/usr/bin:/root/bin"
    GEM_HOME:     "/usr/local/rvm/gems/ruby-1.9.3-p194"
    GEM_PATH:     "/usr/local/rvm/gems/ruby-1.9.3-p194:/usr/local/rvm/gems/ruby-1.9.3-p194@global"
    MY_RUBY_HOME: "/usr/local/rvm/rubies/ruby-1.9.3-p194"
    IRBRC:        "/usr/local/rvm/rubies/ruby-1.9.3-p194/.irbrc"
    RUBYOPT:      ""
    gemset:       ""

Here are the corresponding environmental variables

declare -x GEM_HOME="/usr/local/rvm/gems/ruby-1.9.3-p194"
declare -x GEM_PATH="/usr/local/rvm/gems/ruby-1.9.3-p194:/usr/local/rvm/gems/ruby-1.9.3-p194@global"
declare -x IRBRC="/usr/local/rvm/rubies/ruby-1.9.3-p194/.irbrc"
declare -x MY_RUBY_HOME="/usr/local/rvm/rubies/ruby-1.9.3-p194"
declare -x PATH="/usr/local/rvm/gems/ruby-1.9.3-p194/bin:/usr/local/rvm/gems/ruby-1.9.3-p194@global/bin:/usr/local/rvm/rubies/ruby-1.9.3-p194/bin:/usr/local/rvm/bin:/usr/lib64/qt-3.3/bin:/usr/java/default/bin:/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/usr/sbin:/usr/bin:/root/bin"
declare -x RUBY_VERSION="ruby-1.9.3-p194"

How to get this issue resolved?

解决方案

make sure all the variables all set correctly, especially PATH and GEM_PATH, you can use this code to set the environment for you:

source /usr/local/rvm/environments/ruby-1.9.3-p194

add it in the service before chef-solr is run

这篇关于/ usr / bin / env ruby​​_noexec_wrapper失败,没有文件或目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 06:10