Hi out there,
I'd like to use "FileUtils*", but ruby does not agree:
irb(main):003:0> FileUtils.mkdir('uno')
NameError: uninitialized constant FileUtils
from (irb):3
irb(main):004:0>
But the file ist allreay in the lib:
ram@lilith:~/src/tar$locate fileutils.rb
/usr/local/lib/ruby/1.8/fileutils.rb
Dir works:
irb(main):001:0> Dir.mkdir('uno')
Errno::EEXIST: File exists - uno
from (irb):1:in `mkdir'
from (irb):1
I use ruby rby 1.8.2.
Where's my mistake?
regards
ralf
You have to "require 'fileutils'" before using its methods.
···
* Ralf Müller <r_mueller@imp-ag.de> wrote:
I'd like to use "FileUtils*", but ruby does not agree:
irb(main):003:0> FileUtils.mkdir('uno')
NameError: uninitialized constant FileUtils
from (irb):3
irb(main):004:0>
But the file ist allreay in the lib:
ram@lilith:~/src/tar$locate fileutils.rb
/usr/local/lib/ruby/1.8/fileutils.rb
Where's my mistake?
Thanks Hynek,
of course this fixes the problem.
I'm not that certain about using inernal and external things yet.
best regards
ralf
···
Am Montag, 14. Juni 2004 16:23 schrieb Hynek Schlawack:
* Ralf Müller <r_mueller@imp-ag.de> wrote:
> I'd like to use "FileUtils*", but ruby does not agree:
> irb(main):003:0> FileUtils.mkdir('uno')
> NameError: uninitialized constant FileUtils
> from (irb):3
> irb(main):004:0>
> But the file ist allreay in the lib:
> ram@lilith:~/src/tar$locate fileutils.rb
> /usr/local/lib/ruby/1.8/fileutils.rb
> Where's my mistake?
You have to "require 'fileutils'" before using its methods.