From: Jano Svitok Date: 2007-10-02T04:53:46+09:00 Subject: Re: Calling Ruby from PHP fails on "requires 'mysql'" On 10/1/07, Mark Meijer wrote: > > > > > Thanks again! > > > Saving the stderr gave me > > /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in > `gem_original_require': No such file to load -- mysql (LoadError) > from > /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require' > from /Users/mark/scripts/myscript.rb:31 > > Line 31 is > require 'mysql' > > > So, looks like it can't find the gem in the path. > > I'm able to call the same script from crontab by adding > $LOAD_PATH << File.expand_path(File.dirname(__FILE__)) > > > Any ideas on massaging the path? > > cheers What came to my mind is whether are you using the same ruby in those two cases? Other than that, 1. look up where the mysql lib/gem resides, 2. print out $LOAD_PATH in both cases and compare. You could do system("gem list") as well to check whether gems can find the mysql gem.