[CentOS] /bin/env

Fri Dec 10 19:32:13 UTC 2010
Robert Heller <heller at deepsoft.com>

At Fri, 10 Dec 2010 14:20:12 -0500 (EST) CentOS mailing list <centos at centos.org> wrote:

> 
> Please forgive my ignorance but I need a explanation of how to
> accomplish the following since I cannot figure it out from the
> documents.
> 
> I have a Ruby script with a shebang line that looks like this:
> 
> #!/usr/bin/env ruby
> 
> On one particular host I have two Ruby interpreters installed; one
> the CentOS base version 1.8.6 in /usr/bin/ruby the other version
> 1.8.7 in /usr/local/bin/ruby.  In my shell the which command finds
> /usr/local/bin/ruby.  In a cron job the /usr/bin/ruby is used by the
> /bin/env invocation.
> 
> My question is: How does one configure /bin/env to return the
> /usr/local/bin/ruby version?  or does that question even make sense?

PATH=/usr/local/bin:$PATH

Compare the value of PATH in your shell vs. the cronjob.

> 
> I have looked at the alternatives command but that seems just a tad
> involved.  And since this is a production server I am not quite
> ready to trust to RVM either.
> 
> In the short term I have simply removed the CentOS version which has
> resolved the immediate issue.  However, I would like to know how to
> handle this a little more elegantly in future.
> 
> 
> 
> 

-- 
Robert Heller             -- 978-544-6933 / heller at deepsoft.com
Deepwoods Software        -- http://www.deepsoft.com/
()  ascii ribbon campaign -- against html e-mail
/\  www.asciiribbon.org   -- against proprietary attachments