Forum: Ruby on Rails Non standard rubygems location

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
James H. (Guest)
on 2006-05-30 01:27
(Received via mailing list)

Page 183 of Programming Ruby, talking about the $: load path variable,
states: "You can always add additional directories to this array from
within your running program". So why can't I do this in

$:.concat(Dir["/home/jhughes/lib/ruby/site_ruby/1.8"])  # path points
at my install of rubygems

and then have

    require 'rubygems'

work in boot.rb?

Here's the error log (just trying to get CGI working right now):

[Mon May 29 14:12:32 2006] [error] [client]
`require': no such file to load -- rubygems (LoadError)
[Mon May 29 14:12:32 2006] [error] [client] !from
[Mon May 29 14:12:32 2006] [error] [client] !from
[Mon May 29 14:12:32 2006] [error] [client] !from
[Mon May 29 14:12:32 2006] [error] [client] Premature
end of script headers: dispatch.cgi

I have RUBYLIB set appropriately in my bash_profile and can "require
'rubygems'" in irb, but nothing works trying to make this available to
Apache. I've also tried adding -I to the shebang line, concatting to
ADDITIONAL_LOAD_PATHS in various locations, and probably a few other
things I can't remember. Same result every time.


James H.
Web application developer
Vancouver, BC

"Developing a coherent political analysis is in many respects
contingent upon an ability to connect one context to another, a
process not dissimilar to playing the kid's game of dot-to-dot."
 - Ward Churchill, from '"A Government of Laws"?'
This topic is locked and can not be replied to.