Ok, getting close.
The Ruby version called from PHP is indeed different from the Ruby
called from command line or crontab..
from PHP
/usr/bin/ruby
ruby 1.8.2 (2004-12-25) [universal-darwin8.0]
otherwise
/usr/local/bin/ruby
ruby 1.8.6 (2007-03-13 patchlevel 0) [i686-darwin8.8.2]
I tried adding the path to a system call but it doesn't help
the ruby call and I don't get anything written to the logs..
$s = sprintf("echo $PATH > /Users/../path0.log 2> /Users/../
path1.log");
system($s);
$s = sprintf("export PATH=/usr/local/bin:/usr/local/mysql/bin:$PATH");
system($s);
$s = sprintf("echo $PATH > /Users/../path2.log 2> /Users/../
path3.log");
system($s);
*nix trouble!
PHP probably doesn't run as your user account, so it might use a
different PATH. The path you're using for Ruby is for YOUR user's
shell login.
one way to verify it is to check the user id and process id. you can
use tail for that.
PHP probably uses something set in /env
You would have the same path to Ruby if you didn't have the path
variable set by the dot file in your user account directory when you
do a shell login.
PHP often runs as whatever Apache runs as for user id, and it's not
your user id.
The PHP script may be owned by you, but the process is owned by PHP
or Apache.
The PHP CLI works differently. It runs under your uid, just as Ruby
would.
Anything run by Apache or another server will have a different uid.