1

I've a cron job that is supposed to execute a ruby script but it is failing with:

/bin/sh: 1: jruby: not found

I know I can set manually jruby location but I want cron to pick automatically as this will be deployed in different machines which have different paths of jruby locations.

Any ideas how to achieve this?

zulqarnain
  • 1,695
  • 1
  • 16
  • 33

1 Answers1

0

I think env is your friend.

Assuming JRuby isn't installed in multiple locations on a given box, /usr/bin/env jruby is a more portable means of having the system pick the first jruby instance it finds on the path.

Just make sure the JRuby is actually installed somewhere on the root users' PATH (or whatever user the jruby command runs as).

Chris Mowforth
  • 6,689
  • 2
  • 26
  • 36