0

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

sandy
  • 2,127
  • 4
  • 28
  • 50
  • Are you setting the path like `PATH=$PATH:/Users/Shared/Jenkins/.gem/ruby/2.4.0/bin` ?? You have to assign in back to PATH. Also, it is usually safer to stick your path in the front of $PATH, not at the end. Then you know the version of your file is found first before some other thing that might be in the path that you don't know about. – Rob Hales Nov 08 '17 at 04:35
  • Thanks for the help Rob, even after setting the PATH variable the way you described, I am still getting the same error. – sandy Nov 08 '17 at 06:51

1 Answers1

2

Finally fixed this issue by running the following shell command using Jenkins.

$Home/.rvm/gems/ruby-2.4.1/wrappers/slather

Earlier, I was referring to

$Home/.rvm/gems/ruby-2.4.1/bin/slather

and the bin does not have ruby environment support when executed via shell script.

AATHITH RAJENDRAN
  • 4,689
  • 8
  • 34
  • 58
sandy
  • 2,127
  • 4
  • 28
  • 50