# Development environment bug? (config.load\_paths doesn't take)

**URL:** <https://www.ruby-forum.com/t/development-environment-bug-config-load-paths-doesnt-take/117522>\
**Category:** Rails\
**Created:** [October 17, 2007, 6:04pm UTC](https://www.ruby-forum.com/t/development-environment-bug-config-load-paths-doesnt-take/117522 "2007-10-17T18:04:22Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![student](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ecc23a/32.png) [@student](https://www.ruby-forum.com/u/student)\
**Post date:** [October 17, 2007, 6:04pm UTC](https://www.ruby-forum.com/t/development-environment-bug-config-load-paths-doesnt-take/117522/1 "2007-10-17T18:04:22Z")

</div>

This works for me in production but not development.

Problem:  
I have a need to group models into subdirectories which in no way map  
to models.

Suggested solution (as per article):  
Add the following code to the Rails::Initializer.run block in  
environment.rb:

config.frameworks -= [:action\_web\_service]

config.load\_paths += %W[  
#{RAILS\_ROOT}/app/models/helpers  
#{RAILS\_ROOT}/app/models/autogenerated  
#{RAILS\_ROOT}/app/models/database  
]

New Problem:  
In development mode, these new directories are not picked up.

I’ve tried to trace the flow, but no love.

---

<div class="post-metadata">

**Author:** ![student](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ecc23a/32.png) [@student](https://www.ruby-forum.com/u/student)\
**Post date:** [January 4, 2010, 12:04pm UTC](https://www.ruby-forum.com/t/development-environment-bug-config-load-paths-doesnt-take/117522/2 "2010-01-04T12:04:35Z")

</div>

> In development mode, these new directories are not picked up.

Hi, anyone has an answer for this one?  
I just tried to add some new path same way and it doesn’t seem to pick  
it. Running in development mode yet.

Thanks.

---

<div class="post-metadata">

**Author:** ![student](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ecc23a/32.png) [@student](https://www.ruby-forum.com/u/student)\
**Post date:** [January 6, 2010, 5:39am UTC](https://www.ruby-forum.com/t/development-environment-bug-config-load-paths-doesnt-take/117522/3 "2010-01-06T05:39:30Z")

</div>

On Jan 4, 6:04Â am, comopasta Gr [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > In development mode, these new directories are not picked up.
> 
> Hi, anyone has an answer for this one?  
> I just tried to add some new path same way and it doesn’t seem to pick  
> it. Running in development mode yet.

You’ve posted a quote from _someplace_, likely this list, but without  
any way to reference the original post. Can you give more details?

–Matt J.

---

<div class="post-metadata">

**Author:** ![student](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ecc23a/32.png) [@student](https://www.ruby-forum.com/u/student)\
**Post date:** [January 6, 2010, 9:39am UTC](https://www.ruby-forum.com/t/development-environment-bug-config-load-paths-doesnt-take/117522/4 "2010-01-06T09:39:28Z")

</div>

On Tue, Jan 5, 2010 at 8:37 PM, Matt J. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> You’ve posted a quote from _someplace_, likely this list, but without  
> any way to reference the original post. Can you give more details?
> 
> –Matt J.

Yes, I agree with Matt that’s it’s hard to following the discussion  
without  
knowing  
the original issue.

-Conrad

---

<div class="post-metadata">

**Author:** ![student](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ecc23a/32.png) [@student](https://www.ruby-forum.com/u/student)\
**Post date:** [January 6, 2010, 4:11pm UTC](https://www.ruby-forum.com/t/development-environment-bug-config-load-paths-doesnt-take/117522/5 "2010-01-06T16:11:02Z")

</div>

I’m not sure about your specific problem, but you could try replacing  
your code with the following:

config.load\_paths += Dir["#{RAILS\_ROOT}/app/models/ **/**"]

That loads all files in all subdirs in your models directory. It  
works for me in all environments (in Rails 2.3, at least, haven’t  
tried it on earlier versions).

Casey

---

<div class="post-metadata">

**Author:** ![student](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ecc23a/32.png) [@student](https://www.ruby-forum.com/u/student)\
**Post date:** [January 6, 2010, 11:30am UTC](https://www.ruby-forum.com/t/development-environment-bug-config-load-paths-doesnt-take/117522/6 "2010-01-06T11:30:33Z")

</div>

😃 😃

I can’t deny you are right guys.  
The quote is taken about 100 pixels above my text. It is part of the  
original question of the post (almost the last line in it). I don’t  
really like quoting whole texts because it duplicates all the stuff…

If for some reason you can’t see the original question I paste it here  
again.

* * *

Posted by Student (Guest) on 17.10.2007 18:04  
This works for me in production but not development.

Problem:  
I have a need to group models into subdirectories which in no way map  
to models.

Suggested solution (as per article):  
Add the following code to the Rails::Initializer.run block in  
environment.rb:

config.frameworks -= [:action\_web\_service]

config.load\_paths += %W[  
#{RAILS\_ROOT}/app/models/helpers  
#{RAILS\_ROOT}/app/models/autogenerated  
#{RAILS\_ROOT}/app/models/database  
]

New Problem:  
In development mode, these new directories are not picked up.

I’ve tried to trace the flow, but no love.

* * *

Cheers.

---

<div class="post-metadata">

**Author:** ![student](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ecc23a/32.png) [@student](https://www.ruby-forum.com/u/student)\
**Post date:** [January 6, 2010, 4:25pm UTC](https://www.ruby-forum.com/t/development-environment-bug-config-load-paths-doesnt-take/117522/7 "2010-01-06T16:25:40Z")

</div>

On Jan 6, 10:30Â am, comopasta Gr [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> 😃 😃
> 
> I can’t deny you are right guys.  
> The quote is taken about 100 pixels above my text. It is part of the  
> original question of the post (almost the last line in it). I don’t  
> really like quoting whole texts because it duplicates all the stuff…
> 
> If for some reason you can’t see the original question I paste it here  
> again.

Just to be sure, have you restarted your app after changing  
environment.rb ?

Fred
