# Problems with routes in production mode

**URL:** <https://www.ruby-forum.com/t/problems-with-routes-in-production-mode/69774>\
**Category:** Rails\
**Created:** [September 24, 2006, 1:24am UTC](https://www.ruby-forum.com/t/problems-with-routes-in-production-mode/69774 "2006-09-24T01:24:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![craigrails](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c2a13f/32.png) [@craigrails](https://www.ruby-forum.com/u/craigrails)\
**Post date:** [September 24, 2006, 1:24am UTC](https://www.ruby-forum.com/t/problems-with-routes-in-production-mode/69774/1 "2006-09-24T01:24:24Z")

</div>

I can’t seem to solve this issue on anything but a temporary basis

I have the following line in one of my models…

require “lib/pewholename”

and corresponding file in RAILS\_ROOT/lib/pewholename.rb

This works perfectly in development mode.

In production environment, that will give me an error…

/usr/lib/site\_ruby/1.8/rubygems/custom\_require.rb:27:in  
`gem\_original\_require’: no such file to load – lib/pewholename.rb

In ‘script/console production’ the same ’ require “lib/pewholename” ’  
works fine (answers true)

To work this week, I changed the require statement to

require “…/lib/pewholename”

which has gotten me through the week

Can anyone suggest what I need to look at to fix this issue?

Craig

---

<div class="post-metadata">

**Author:** ![craigrails](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c2a13f/32.png) [@craigrails](https://www.ruby-forum.com/u/craigrails)\
**Post date:** [September 24, 2006, 3:51pm UTC](https://www.ruby-forum.com/t/problems-with-routes-in-production-mode/69774/2 "2006-09-24T15:51:52Z")

</div>

I’d really love some help on this - even if speculative…

---

<div class="post-metadata">

**Author:** ![craigrails](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c2a13f/32.png) [@craigrails](https://www.ruby-forum.com/u/craigrails)\
**Post date:** [September 24, 2006, 9:32pm UTC](https://www.ruby-forum.com/t/problems-with-routes-in-production-mode/69774/3 "2006-09-24T21:32:26Z")

</div>

On 9/23/06, Craig W. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> require “…/lib/pewholename”
> 
> which has gotten me through the week
> 
> Can anyone suggest what I need to look at to fix this issue?

require ‘lib/pewholename’ relies on ‘.’ being in your $LOAD\_PATH and  
having  
started the app (or script/console) from RAILS\_ROOT.

require ‘…/lib/pewholename’ relies on ‘.’ being in your $LOAD\_PATH and  
lighttpd having done a chdir to RAILS\_ROOT/public

Simply require ‘pewholename’ since lib is already in your $LOAD\_PATH

jeremy

---

<div class="post-metadata">

**Author:** ![craigrails](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/c2a13f/32.png) [@craigrails](https://www.ruby-forum.com/u/craigrails)\
**Post date:** [September 26, 2006, 1:24pm UTC](https://www.ruby-forum.com/t/problems-with-routes-in-production-mode/69774/4 "2006-09-26T13:24:38Z")

</div>

On Sun, 2006-09-24 at 12:27 -0700, Jeremy K. wrote:

> ```
> and corresponding file in RAILS_ROOT/lib/pewholename.rb 
> "lib/pewholename" '
> 
> ```
> 
> require ‘lib/pewholename’ relies on ‘.’ being in your $LOAD\_PATH and  
> having started the app (or script/console) from RAILS\_ROOT.
> 
> require ‘…/lib/pewholename’ relies on ‘.’ being in your $LOAD\_PATH  
> and lighttpd having done a chdir to RAILS\_ROOT/public
> 
> Simply require ‘pewholename’ since lib is already in your $LOAD\_PATH

* * *

yup - thanks

Craig
