From: Rein Henrichs Date: 2010-06-11T20:50:09+09:00 Subject: Re: require command problem On 2010-06-11 04:04:46 -0700, Pen Ttt said: > i have write a class ,use command to put in the > /usr/lib/ruby/1.8/rubygems/Webmovie.rb > sudo cp /tmp/Webmovie.rb /usr/lib/ruby/1.8/rubygems/Webmovie.rb > Code.rb is my calss ,also in /usr/lib/ruby/1.8/rubygems/ > > > pt@pt-laptop:~$ irb > irb(main):001:0> require 'Code' > => true > irb(main):002:0> require 'Webmovie' > LoadError: no such file to load -- Webmovie > from (irb):2:in `require' > from (irb):2 > from :0 > irb(main):003:0> require '/usr/lib/ruby/1.8/rubygems/Webmovie' > => true > irb(main):004:0> > > how can i use command require 'Webmovie' to get the class work? Your filenames should not use uppercase letters. You should not move things into the rubygems directory manually. You should access them from within your library or from an installed gem. Look at any Ruby library to see correct directory structure, file names and use of require. -- Rein Henrichs http://puppetlabs.com http://reinh.com