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 8481847
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T19:40:20+00:00 2026-06-10T19:40:20+00:00

At the top of my main application file (tinyclone.rb) in a Sinatra app, this

  • 0

At the top of my main application file (tinyclone.rb) in a Sinatra app, this hash is used to require several gems and one file ‘dirtywords.rb.’ The dirty words file is in the same directory as the tinyclone.rb file.

%w(rubygems data_mapper sinatra haml dm-core dm-timestamps dm-types uri restclient xmlsimple dirty_words).each  { |lib| require lib}

When I load the tinyclone.rb file in irb

require '/Users/mm/sites/cloning/tinyclone.rb'

it loads all of those files/gems in the hash, except for the dirty_words file

cannot load such file -- dirty_words
    from /Users/mm/.rvm/rubies/ruby-1.9.3-rc1/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
    from /Users/mm/.rvm/rubies/ruby-1.9.3-rc1/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in `require'
    from /Users/mm/sites/cloning/tinyclone.rb:1:in `block in <top (required)>'
    from /Users/mm/sites/cloning/tinyclone.rb:1:in `each'
    from /Users/mm/sites/cloning/tinyclone.rb:1:in `<top (required)>'
    from /Users/mm/.rvm/rubies/ruby-1.9.3-rc1/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /Users/mm/.rvm/rubies/ruby-1.9.3-rc1/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from (irb):1
    from /Users/mm/.rvm/rubies/ruby-1.9.3-rc1/bin/irb:16:in `<main>'

Can anyone explain why that one file is not being required properly?

  • 1 1 Answer
  • 0 Views
  • 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-06-10T19:40:21+00:00Added an answer on June 10, 2026 at 7:40 pm

    Ruby 1.9 doesn’t include current dir into search path.

    There are several options to work around this:

    # Ruby 1.9 only:
    require_relative 'dirty_words'
    
    # Ruby 1.9 and 1.8 compatible:
    require File.expand_path('dirty_words', File.dirname(__FILE__))
    
    # Both options above imply that you separate `dirty_words` from the list of libs which
    # are present in $LOAD_PATH, and require it separately. Here's another option which
    # should allow you to keep require iteration as it is, though it's considered dirty:
    $LOAD_PATH << File.dirname(__FILE__)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I get this when I run a main.rb file from OSX command line `require':
The ChildBrowser PhoneGap plugin uses a WebView on top of our main application in
We created an ADO.NET Services on top of our EDMX file as the main
I'm developing web page which has main file index.php as follows: include('UserClass.php'); include('html/top.php'); $user
i am new to android.i have one single activity with main.xml file. Now, i
I'm referring to this article here http://codebrief.com/2012/01/the-top-10-javascript-mvc-frameworks-reviewed/ In my current application I have two
When the application loads, it calls app.js (This is called in the index.html). What
My application.html.erb (main layout) has some categories on the top of the header, and
If I have a config.ru file like this: def my_method 1+2 end require 'my_sinatra_app'
In my application I'm generating an Excel file using the POI API. One of

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.