From: "ara.t.howard" Date: 2008-08-15T02:17:34+09:00 Subject: Re: Uninitialized constant: String::StringIO On Aug 14, 2008, at 10:57 AM, Patrick Li wrote: > Thanks Ara, > > Just out of curiosity, why is it that I need > require "stringio" when running as a script under Apache, but not > when I > run under irb? > > Is there a way to tell when I need to require a library and when I > don't? (ie. from documentation, etc...) irb simply had already required it. there is no general way to tell but, in this case you could check $LOADED_FEATURES or, more simply require 'stringio' unless defined?(StringIO) but the require never hurts so just do it anyhow a @ http://codeforpeople.com/ -- we can deny everything, except that we have the possibility of being better. simply reflect on that. h.h. the 14th dalai lama