# Files in lib directory not loading

**URL:** <https://www.ruby-forum.com/t/files-in-lib-directory-not-loading/185650>\
**Category:** Rails\
**Created:** [March 24, 2010, 3:36am UTC](https://www.ruby-forum.com/t/files-in-lib-directory-not-loading/185650 "2010-03-24T03:36:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [March 24, 2010, 3:36am UTC](https://www.ruby-forum.com/t/files-in-lib-directory-not-loading/185650/1 "2010-03-24T03:36:01Z")

</div>

Hi there

I’m trying to install this rack application:  
[http://fuelyourcoding.com/set-rails-logging-on-fire/](http://fuelyourcoding.com/set-rails-logging-on-fire/)

However, my rails3 setup is not picking up my lib file:

app/lib/rack/firebug\_logger.rb

which contains:

module Rack  
class FirebugLogger  
…  
end  
end

And in my config/environments/development.rb :

App::Application.configure do  
…  
config.middleware.use Rack::FirebugLogger  
end

But rails3 is not finding my lib file ☹

uninitialized constant Rack::FirebugLogger (NameError)

Any clues?

thanks!

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [March 25, 2010, 5:10am UTC](https://www.ruby-forum.com/t/files-in-lib-directory-not-loading/185650/2 "2010-03-25T05:10:11Z")

</div>

Is “app/lib/rack/firebug\_logger.rb” simply the wrong direcotry?

Or is there something I need to do to make it work?

If I put…

module Rack  
class FirebugLogger  
…  
end  
end

… inside my application controller it all works fine –  
Rack::FirebugLogger is accessible and works.

thanks for any advice

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [March 26, 2010, 5:57am UTC](https://www.ruby-forum.com/t/files-in-lib-directory-not-loading/185650/3 "2010-03-26T05:57:37Z")

</div>

Does anyone have any clues of suggestions?

I’m not even sure how to manually load Rack::Firebugger in “app/lib/  
rack/firebug\_logger.rb”

But would rather it just automatically loaded

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [April 6, 2010, 10:28pm UTC](https://www.ruby-forum.com/t/files-in-lib-directory-not-loading/185650/4 "2010-04-06T22:28:10Z")

</div>

There is a typo on the blog post you referred to. It should go in lib/  
not app/lib.

Also from the same post:  
“Rails autoloads (and namespaces) any code placed in the lib directory,  
so that is where weâ€™ll place our FirebugLogger code.”

–Daniel

removed\_email\_address@domain.invalid wrote:

> Does anyone have any clues of suggestions?
> 
> I’m not even sure how to manually load Rack::Firebugger in “app/lib/  
> rack/firebug\_logger.rb”
> 
> But would rather it just automatically loaded
