From: Jim Weirich Date: 2004-12-09T03:57:17+09:00 Subject: Re: [ANN] RubyScript2Exe 0.2.0 itsme213 said: > I am trying to settle on one standard way to use my gems transparently > i.e. > without something like 'require_gem' (or was that 'gem_require'?). While > GEM_PATH seems to work, it appears to cause problems with other apps or > libs that assume Rubys standard directory layout. > > Advice? If you don't care what version you get, just do a normal require. In addition, you need to make sure the rubygems library is loaded. You can do this by: * explicitly requiring 'rubygems' before requiring any file that would be in a gem.[1] * explicitly starting ruby with a -rubygems command line option. * Setting the RUBYOPT environment variable to 'rubygems' If you /do/ care about which the version of a gem you are using, then use a require_gem command with explicit versioning requirements. Again, make sure the rubygems library is loaded using one of the above three techniques. Regarding your GEM_PATH comment, I'm not sure what you are getting at. GEM_PATH is for specifying where multiple gem repositories are locally stored. Were you refering to RUBYOPT? -- -- Jim Weirich jim@weirichhouse.org http://onestepback.org ----------------------------------------------------------------- "Beware of bugs in the above code; I have only proved it correct, not tried it." -- Donald Knuth (in a memo to Peter van Emde Boas) [1] If you do choose to explicitly include rubygems, but don't want to depend on rubygems always being available, do this: begin require 'rubygems' rescue LoadError end