Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 680419
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T01:22:14+00:00 2026-05-14T01:22:14+00:00

In irb, I do this class Text include FileUtils end I get: NameError: uninitialized

  • 0

In irb, I do this

class Text
  include FileUtils
end

I get: NameError: uninitialized constant Test::FileUtils

If I just do: include FileUtils (i.e. now class) everthing works.

What gives?

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T01:22:15+00:00Added an answer on May 14, 2026 at 1:22 am

    You need to make sure Ruby knows about the FileUtils module. That module isn’t loaded by default:

    >> FileUtils
    NameError: uninitialized constant FileUtils
        from (irb):1
    >> require 'fileutils'
    => true
    >> FileUtils
    => FileUtils
    

    Don’t worry too much about the error NameError: uninitialized constant Text::FileUtils – when you try to include a constant that Ruby doesn’t know about, it looks in a few places. In your case, first it will look for Text::FileUtils and then it will look for ::FileUtils in the root namespace. If it can’t find it anywhere (which in your case it couldn’t) then the error message will tell you the first place it looked.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Say I have this Ruby code in test.rb module MyModule class TestClassA end class
how does this work? in irb: >> class A >> b = [1, 2,3]
I'm having trouble understanding this behaviour of the Ruby Matrix class, is it just
I'm trying compass in irb, this is my code: C:\Documents and Settings\test>irb irb(main):001:0> require
I was testing my code in IRB and I typed in this: class be
This works: >> class Foo >> def xyz() >> Foo.subclasses >> end >> end
Can i do editing in the irb shell ? irb(main):001:0> class MyClass irb(main):002:1> def
I have this nokogiri object: element.first => #<Nokogiri::XML::Element:0x3fc0cf8ac4b8 name=a attributes=[#<Nokogiri::XML::Attr:0x3fc0cf8ac454 name=class value=fl>, #<Nokogiri::XML::Attr:0x3fc0cf8ac42c name=id
I have a class like: class Configuration def self.files @@files ||= Array.new end end
IRB is a nice way to play around and test things in Ruby. It's

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.