# Strange issue locating a file

**URL:** <https://www.ruby-forum.com/t/strange-issue-locating-a-file/55580>\
**Category:** Rails\
**Created:** [March 22, 2006, 7:44am UTC](https://www.ruby-forum.com/t/strange-issue-locating-a-file/55580 "2006-03-22T07:44:45Z")\
**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:** [March 22, 2006, 7:44am UTC](https://www.ruby-forum.com/t/strange-issue-locating-a-file/55580/1 "2006-03-22T07:44:45Z")

</div>

I have been editing a branch on my Fedora system, completed the changes  
and was satisfied that it works and using svn, merged it to my main  
trunk. I have been testing the main trunk and it seems fine. I committed  
my changes to the svn repository.

On my live web application, I did an ‘svn update’ which brought all the  
files in but when I launch, I get an error on my log/production.log…

Processing Base#index (for 192.168.3.7 at 2006-03-21 22:56:07) [GET]  
Parameters: {}

MissingSourceFile (no such file to load – config/defaults.rb):

The file is clearly there. It is called for at the top of my  
‘application.rb’ file…

# Contains the authentication and authorization code structures

require “config/defaults.rb”

class ApplicationController \< ActionController::Base

The file is new - came from the branch and does exist in the newly  
updated trunk…the entire log of the update is at the bottom of this  
email (not long) but there is nothing to suggest what could cause this  
as far as I can tell. I’m thinking that the reference to  
config/defaults.rb is handled differently on my Fedora development  
system at home than it is handled on my Centos-4 server.

Any clues ? Both of these systems have the same ‘routes.rb’

Craig

$ svn update  
A app/models/notifier.rb  
A app/models/error\_mailer.rb  
U app/models/facility.rb  
U app/models/placement.rb  
U app/controllers/application.rb  
U app/controllers/reports\_controller.rb  
A app/views/notifier  
A app/views/error\_mailer  
U app/views/login/\_motd.rhtml  
U app/views/placements/\_form.rhtml  
U app/views/placements/show.rhtml  
A app/views/reports/client\_list\_all.rhtml  
U app/views/reports/vo\_res\_census\_all.rhtml  
U app/views/reports/rfn2.rhtml  
A app/views/reports/\_client\_list.rhtml  
U app/views/reports/rfn3.rhtml  
A app/views/reports/voc\_bhp\_all.rhtml  
A app/views/reports/client\_list.rhtml  
U app/views/reports/rfn4.rhtml  
U app/views/reports/\_vo\_res\_census.rhtml  
U app/views/reports/vo\_weekly\_census\_all.rhtml  
U app/views/reports/vo\_res\_census.rhtml  
A app/views/reports/\_voc\_bhp.rhtml  
A app/views/reports/voc\_bhp.rhtml  
U app/views/reports/fac\_log\_all.rhtml  
U app/views/reports/\_vo\_weekly\_census.rhtml  
U app/views/reports/\_fac\_log-bak.rhtml  
U app/views/reports/disc\_notif\_vo.rhtml  
U app/views/reports/forms.rhtml  
U app/views/reports/\_fac\_log.rhtml  
A test/unit/notifier\_test.rb  
A test/unit/error\_mailer\_test.rb  
A test/fixtures/notifier  
A test/fixtures/error\_mailer  
U db/schema.rb  
A th-db-postgres.sql  
U config/environments/development.rb  
A config/defaults.rb  
U public/stylesheets/print.css  
U public/stylesheets/th\_stylesheet.css  
Updated to revision 21.

---

<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:** [March 22, 2006, 4:04pm UTC](https://www.ruby-forum.com/t/strange-issue-locating-a-file/55580/2 "2006-03-22T16:04:09Z")

</div>

OK, I have about an hour to solve this before they are going to need  
access.

updated per below.

logs say,

Processing Base#index (for 192.168.3.7 at 2006-03-22 07:52:46) [GET]  
Parameters: {}

MissingSourceFile (no such file to load – config/defaults.rb):  
/usr/lib/site\_ruby/1.8/rubygems/custom\_require.rb:21:in `require\_\_’

if I use console, it works…

$ ruby script/console production  
Loading production environment.

> > require “config/defaults.rb”  
> > =\> true

Why would it find the file in console but not in the application itself?

development mode works fine, console or web (webrick)

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:** [March 22, 2006, 6:10pm UTC](https://www.ruby-forum.com/t/strange-issue-locating-a-file/55580/3 "2006-03-22T18:10:08Z")

</div>

Craig–

Check your shebang line in dispatch.fcgi (I assume you are running  
fcgi).  
That’s a likely culprit.

Steve

---

<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:** [March 22, 2006, 7:46pm UTC](https://www.ruby-forum.com/t/strange-issue-locating-a-file/55580/4 "2006-03-22T19:46:39Z")

</div>

hmm…seems to be unchanged from rails creation…

require File.dirname( **FILE** ) + “/…/config/environment”  
require ‘fcgi\_handler’

RailsFCGIHandler.process!

I do have one other thing that might impact this but this is not  
directly related to fcgi…

I have this change in config/routes.rb  
map.connect ‘/’, :controller =\> “login”, :action =\> ‘login’

I ended up moving the ‘missing file’ from config/defaults.rb to  
app/models/defaults.rb and changed my reference in application.rb to  
simply 'require “defaults.rb”

and that made everything happy - I needed them to be  
functional…desperate times call for desperate methods. I can’t play  
with it until after work today.

Since I had made the change on a separate branch of subversion code  
running on my home setup in development mode and had been working for a  
few weeks with that, I figured that it would make the move to another  
server and another mode without an issue…I was wrong.

Since it worked ok with ‘ruby script/console production’ - I have to  
agree that it is something like the fcgi mode of apache doing that to  
me. I don’t know how to fix it other than the way I have handled it but  
I do want all of the paths to function identically between fcgi and  
non-fcgi modes so I don’t get future surprises.

Thanks

Craig
