Can't use FileUtils

Discussion in 'Ruby' started by Ralf Müller, Jun 14, 2004.

  1. Ralf Müller

    Ralf Müller Guest

    Hi out there,

    I'd like to use "FileUtils*", but ruby doe'nt 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
     
    Ralf Müller, Jun 14, 2004
    #1
    1. Advertising

  2. il Mon, 14 Jun 2004 23:07:34 +0900, Ralf Müller <>
    ha scritto::

    >Hi out there,
    >
    >I'd like to use "FileUtils*", but ruby doe'nt 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


    the 1.8 dir is there for you to require files. The builtin stuff like
    Dir does not have extenrals files, so:
    require 'filutils.rb'
    FileUtils.mkdir_p domething
     
    gabriele renzi, Jun 14, 2004
    #2
    1. Advertising

  3. Ralf Müller

    Ralf Müller Guest

    Am Montag, 14. Juni 2004 16:13 schrieb gabriele renzi:
    > il Mon, 14 Jun 2004 23:07:34 +0900, Ralf Müller <>
    >
    > ha scritto::
    > >Hi out there,
    > >
    > >I'd like to use "FileUtils*", but ruby doe'nt 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

    >
    > the 1.8 dir is there for you to require files. The builtin stuff like
    > Dir does not have extenrals files, so:
    > require 'filutils.rb'
    > FileUtils.mkdir_p domething


    Thanks (or "Vielen Dank"), Gabriele.
    Works fine now.

    bets regards
    ralf
     
    Ralf Müller, Jun 14, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. mahesh
    Replies:
    1
    Views:
    628
    Andrew Thompson
    Dec 7, 2006
  2. Grzegorz Chrupala
    Replies:
    2
    Views:
    239
    Grzegorz Chrupala
    Jun 30, 2003
  3. Chad Fowler

    Fileutils.cp bug?

    Chad Fowler, Nov 17, 2003, in forum: Ruby
    Replies:
    2
    Views:
    199
  4. Jim Freeze

    FileUtils Bug in 1.8.0

    Jim Freeze, Apr 22, 2004, in forum: Ruby
    Replies:
    0
    Views:
    119
    Jim Freeze
    Apr 22, 2004
  5. Tara Keane
    Replies:
    7
    Views:
    103
    Tara Keane
    Dec 1, 2010
Loading...

Share This Page