All,
Apache 2/FastCGI on Linux
My fastcgi config. file is set up to run the “test” RAILS_ENV.
When I go to access a view associated with a particular controller, I
keep getting a ENOENT (file not found) error on a custom config. file
that I am attempting to load.
What I can’t figure out is why it can’t find the file.
Here’s the code that loads it in my controller:
require ‘yaml’
class ESimplyController < ApplicationController
@@config = “”
@@config = YAML.load_file(“config/eSimplyConf.yml”)
This setup works fine in my development environment.
When this code gets called, I get the following error in my test.log
file:
Errno::ENOENT (No such file or directory - config/eSimplyConf.yml):
/usr/lib/ruby/1.8/yaml.rb:143:in initialize' /usr/lib/ruby/1.8/yaml.rb:143:in
load_file’
/app/controllers/e_simply_controller.rb:5
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in
require' /usr/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependenc ies.rb:147:in
require’
/usr/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependenc
ies.rb:65:in require_or_load' /usr/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependenc ies.rb:30:in
depend_on’
/usr/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependenc
ies.rb:85:in require_dependency' /usr/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependenc ies.rb:98:in
const_missing’
/usr/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependenc
ies.rb:131:in const_missing' /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/routing. rb:237:in
traverse_to_controller’
generated/routing/recognition.rb:30:in eval' /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/routing. rb:237:in
traverse_to_controller’
generated/routing/recognition.rb:30:in recognize_path' /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/routing. rb:477:in
recognize!’
/usr/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/dispatcher.rb:38:in
dispatch' /usr/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/fcgi_handler.rb:150:in
process_
request’
/usr/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/fcgi_handler.rb:54:in
process!' /usr/lib/ruby/1.8/fcgi.rb:600:in
each_cgi’
/usr/lib/ruby/1.8/fcgi.rb:117:in session' /usr/lib/ruby/1.8/fcgi.rb:104:in
each_request’
/usr/lib/ruby/1.8/fcgi.rb:36:in each' /usr/lib/ruby/1.8/fcgi.rb:597:in
each_cgi’
/usr/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/fcgi_handler.rb:53:in
process!' /usr/lib/ruby/gems/1.8/gems/rails-1.1.2/lib/fcgi_handler.rb:23:in
process!’
/var/www/html/eSimplyTest/public/dispatch.fcgi:26
Rendering
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/te
mplates/rescues/layout.rhtml (500 Internal Error)
=========== END OF ERROR =======================
I’m under the impression that the relative path to my config file is OK
and that it will just be interpreted relative to RAILS_ROOT (which to
the best of my knowledge, is correct)? Is that not true for some
reason?
Thanks,
Wes