From: Phillip Gawlowski Date: 2007-04-07T03:50:19+09:00 Subject: Re: gem and uninitialized constant John J. Franey wrote: > Brian, > > Thanks for responding: > > This code: > > require 'rubygems' > require 'netaddr' > ipadd = NetAddr::CIDR.create("192.9.200.0/24") > > gives: > > /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in > `gem_original_require': no such file to load -- netaddr (LoadError) > from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in > `require' > from ci.rb:2 > > This code: > > require 'rubygems' > require 'net_addr' > ipadd = NetAddr::CIDR.create("192.9.200.0/24") > > works. > > Now, how am I supposed to learn the right string to put into the require > call. The command to install was: > > gem install netaddr If the gem generates documentation, I'd look there. Otherwise, look into your /usr/lib/ruby/gems/1.8/name_of_gem directories for a README or code code examples. In case you didn't know it gem_server launches a small server, which makes the RDoc documentation accessible (in case the developer was smart enough to include such a thing ;) Otherwise, you might take your chances and even look at the gem's homepage. in this case, it probably is http://netaddr.rubyforge.org P.S.: A: Because it makes reading replies difficult. Q: Why is top-posting bad? -- Phillip "CynicalRyan" Gawlowski http://cynicalryan.110mb.com/ Rule of Open-Source Programming #1: Don't whine unless you are going to implement it yourself.