问题
I am trying to configure slather on my Jenkins server. Everything works fine when I run slather command using Terminal, but the script seems to fail when I run it on the Jenkins server. Each time I get env: ruby_executable_hooks: No such file or directory error when I run the script on the jenkins server.
Here is the script I am running through slather
slather coverage -x --output-directory /Users/Shared/Jenkins/Home/workspace/TestApp/test-reports/ --scheme TestApp /Users/Shared/Jenkins/Home/workspace/TestApp/TestApp.xcodeproj
Here is the PATH variable I am setting while executing this shell
$PATH:/Users/Shared/Jenkins/.gem/ruby/2.4.0/bin
回答1:
Finally fixed this issue by running the following shell command using Jenkins.
$Home/.rvm/gems/ruby-2.4.1/wrappers/slather
Earlier, I was reffering to
$Home/.rvm/gems/ruby-2.4.1/bin/slather
and the bin does not have ruby environment support when exectued via shell script.
来源:https://stackoverflow.com/questions/47163349/error-env-ruby-executable-hooks-no-such-file-or-directory-while-running-slathe