Note that there are some explanatory texts on larger screens.

plurals
  1. POApache with Ruby - Gems Issue
    primarykey
    data
    text
    <p>I have this working on Ubuntu fine, but I can't get it to work on Mac OS-X 10.6.7.</p> <p>My Apache config file is edited so that it runs any <code>.rb</code> files. The ruby script I'm using has <code>require 'rubygems'</code> in there.</p> <p>On Ubuntu, I added <code>SetEnv RUBYOPT rubygems</code> in my Apache config file so I don't even need to use <code>require 'rubygems'</code>. On my Mac, even when I require rubygems, it can't load the gems.</p> <p>In IRB, it loads the gems fine, and I can run the script from the command line OK.</p> <p>My script is at /Library/WebServer/Documents</p> <p>Apache error log says - </p> <pre> [Mon May 23 18:56:40 2011] [error] [client ::1] /Library/Ruby/Gems/1.8/gems/dbi-0.4.5/lib/dbi/utils/date.rb:57: undefined method `deprecate' for DBI::Date:Class (NoMethodError) [Mon May 23 18:56:40 2011] [error] [client ::1] \tfrom /Library/Ruby/Site/1.8/rubygems/custom_require.rb:36:in `gem_original_require' [Mon May 23 18:56:40 2011] [error] [client ::1] \tfrom /Library/Ruby/Site/1.8/rubygems/custom_require.rb:36:in `require' [Mon May 23 18:56:40 2011] [error] [client ::1] \tfrom /Library/Ruby/Gems/1.8/gems/dbi-0.4.5/lib/dbi/utils.rb:56 [Mon May 23 18:56:40 2011] [error] [client ::1] \tfrom /Library/Ruby/Site/1.8/rubygems/custom_require.rb:36:in `gem_original_require' [Mon May 23 18:56:40 2011] [error] [client ::1] \tfrom /Library/Ruby/Site/1.8/rubygems/custom_require.rb:36:in `require' [Mon May 23 18:56:40 2011] [error] [client ::1] \tfrom /Library/Ruby/Gems/1.8/gems/dbi-0.4.5/lib/dbi.rb:50 [Mon May 23 18:56:40 2011] [error] [client ::1] \tfrom /Library/Ruby/Site/1.8/rubygems/custom_require.rb:58:in `gem_original_require' [Mon May 23 18:56:40 2011] [error] [client ::1] \tfrom /Library/Ruby/Site/1.8/rubygems/custom_require.rb:58:in `require' [Mon May 23 18:56:40 2011] [error] [client ::1] \tfrom /Library/WebServer/Documents/ruby_file.rb:6 </pre> <p>I thought that adding <code>require 'rubygems'</code> meant that the gem paths would be loaded. Anyone know why Apache can't load the gems?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload