No such file to load, Model/Lib naming conflict?

Posted by Tom on Stack Overflow See other posts from Stack Overflow or by Tom
Published on 2010-05-05T21:24:09Z Indexed on 2010/05/05 21:28 UTC
Read the original article Hit count: 214

I'm working on a Rails application. I have a Module called Animals. Inside this Module is a Class with the same name as one of my Models (Dog).

show_animal action:


def show_animal
  require 'Animals/Bear.rb' #Works
  require 'Animals/Dog.rb' #Fails
end

So the first require definitely works, the seconds fails. MissingSourceFile (no such file to load -- Animals/Dog.rb):

I noticed that Dog.rb is the same file name as one of my models, is that what's causing this? I'm using Webrick.

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about webrick