Forum: Ruby on Rails Non standard rubygems location

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
E74a19a983b0da1c671de90b341e7c06?d=identicon&s=25 James Hughes (Guest)
on 2006-05-29 23:27
(Received via mailing list)
Hi,

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
environment.rb:

$:.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 192.168.0.112]
/projects/active/pts/public/current/public/../config/boot.rb:18:in
`require': no such file to load -- rubygems (LoadError)
[Mon May 29 14:12:32 2006] [error] [client 192.168.0.112] !from
/projects/active/pts/public/current/public/../config/boot.rb:18
[Mon May 29 14:12:32 2006] [error] [client 192.168.0.112] !from
/projects/active/pts/public/current/public/../config/environment.rb:8
[Mon May 29 14:12:32 2006] [error] [client 192.168.0.112] !from
/projects/active/pts/public/current/public/dispatch.cgi:3
[Mon May 29 14:12:32 2006] [error] [client 192.168.0.112] 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.

jh


--
James Hughes
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.