From: James Britt Date: 2010-01-31T15:43:45+09:00 Subject: Re: "require 'rubygems'" In Your Library/App/Tests Is Wrong? Intransition wrote: > > On Jan 30, 9:18 pm, James Britt wrote: >> Intransition wrote: >>> You should not have to do that. Just add '-rubygems' to your RUBYOPT >>> environment variable --that's a necessary part of setting up RubyGems >>> for one's system. >> Not for me. I stopped doing that a while ago. > > How so? I can understand that for web app. But not for reusable ruby > library. > I don't follow. When I write my apps and library, I want to be sure that rubygems is only used when I decide it's appropriate. Leaving rubygems out of RUBYOPT settings doesn't stop me from doing anything. Truthfully, I'm puzzled by the idea of implicitly requiring a library for *every* piece of ruby you run. (Of course, in 1.9, it becomes more like String than, say, Yaml. But imagine you have RUBYOPT pulling in YAML for every thing you do. At some point this will bite you.) I've helped more than one person sort out a "missing file" mystery by pointing out that the system they are currently using does not have magic gem inclusion; seems some number of new rubyists don't even know when they have RUBYOPT doing things for them. -- James Britt www.jamesbritt.com - Playing with Better Toys www.ruby-doc.org - Ruby Help & Documentation www.rubystuff.com - The Ruby Store for Ruby Stuff www.neurogami.com - Smart application development