On Jan 26, 2007, at 14:48, Austin 7873 wrote:
> After upgrading to RubyGems 0.9.1, I'm seeing the following error:
>
> irb(main):001:0> require 'rubygems'
> => true
> irb(main):002:0> gem 'uuid'
> => true
> irb(main):003:0> UUID.new
> NameError: uninitialized constant UUID
>         from (irb):3
> irb(main):004:0>

This is expected, you haven't required 'uuid' yet.

> This problem doesn't happen if I use:
>
> require 'uuid'

#gem only adds a gem's paths to the load path.  You still need to  
require the library you're interested in.

> or
>
> require_gem 'uuid'

#require_gem triggers the deprecated auto-require feature (deprecated  
along with #require_gem in 0.9.0).  RubyGems custom require is smart,  
so auto-require is no longer necessary.

You really only need to use #gem when you need a specific version of  
a gem loaded.

Usually:

require 'rubygems'
require 'uuid'

is all you need.

-- 
Eric Hodel - drbrain / segment7.net - http://blog.segment7.net

I LIT YOUR GEM ON FIRE!