Strange issue locating a file

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 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’


$ 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.

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

updated per below.

logs say,

Processing Base#index (for 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)



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


hmm…seems to be unchanged from rails creation…

require File.dirname(FILE) + “/…/config/environment”
require ‘fcgi_handler’


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.



This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs