Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 16 Dec 2009 21:53:49 -0700 (MST)
From:      Warren Block <wblock@wonkity.com>
To:        Kevin <battdude@gmail.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: portupgrade failure
Message-ID:  <alpine.BSF.2.00.0912162149360.99022@wonkity.com>
In-Reply-To: <alpine.BSF.2.00.0912162105340.98796@wonkity.com>
References:  <7314e5020912161917s355d02c9l16c996043c753044@mail.gmail.com> <alpine.BSF.2.00.0912162105340.98796@wonkity.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 16 Dec 2009, Warren Block wrote:

> On Wed, 16 Dec 2009, Kevin wrote:
>
> [...]
>
>> The only other symptoms I can identify right now are related to the
>> following entries in my crontab:
>> 
>> 0 2 * * 6       /usr/local/sbin/portsclean -DD
>> 0 2 * * 5       /usr/local/sbin/portsclean -C
>> 
>> The e-mailed results simply say "env: ruby: No such file or
>> directory". However, these commands seem to run fine from an
>> interactive shell (while logged in).
>
> Paths.  When there's a problem with cron it's (almost) always paths. 
> portsclean is a ruby script that starts with this line:
>
> #!/usr/bin/env ruby
>
> That should find and run ruby.  Your /etc/crontab should have these lines:
>
> SHELL=/bin/sh
> PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin

And now that I tried a test with these manual paths, the same thing 
happens:

# setenv PATH /etc:/bin:/sbin:/usr/bin:/usr/sbin
# env ruby
env: ruby: No such file or directory

Doh.  ruby and ruby18 are in /usr/local/bin.

So it's working as designed.  A reasonable way to fix this is to add 
:/usr/local/bin to the crontab path, but that may not be the right way 
to fix it.

-Warren Block * Rapid City, South Dakota USA



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?alpine.BSF.2.00.0912162149360.99022>