How to see Ruby error when called from PHP

M

Mark Meijer

I'm not seeing an error message when I call my Ruby script from PHP with

$s = sprintf("ruby /Users/mark/scripts/myscript.rb >
/Users/mark/scripts/myscript.log &");
system($s);

I see print statements from my script in the log file, no errors.


The script is crashing on "requires 'mysql'"

$LOAD_PATH << File.expand_path(File.dirname(__FILE__))
require 'rubygems'
require 'mysql'


I'm able to run the same script from crontab with the expand_path.


Any ideas?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,772
Messages
2,569,593
Members
45,112
Latest member
BrentonMcc
Top