# Rails unrecoverable error

**URL:** <https://www.ruby-forum.com/t/rails-unrecoverable-error/189353>\
**Category:** Rails\
**Created:** [May 29, 2010, 2:19pm UTC](https://www.ruby-forum.com/t/rails-unrecoverable-error/189353 "2010-05-29T14:19:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rubybox](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/85e7bf/32.png) [@rubybox](https://www.ruby-forum.com/u/rubybox)\
**Post date:** [May 29, 2010, 2:19pm UTC](https://www.ruby-forum.com/t/rails-unrecoverable-error/189353/1 "2010-05-29T14:19:27Z")

</div>

Im working on an app but have been plagued by an unrecoverable error

module ApplicationConfiguration  
require ‘ostruct’  
require ‘yaml’

if File.exists?( File.join(Rails.root, ‘config’,  
‘application.yml’) )  
file = File.join(Rails.root, ‘config’, ‘application.yml’)  
users\_app\_config = YAML.load\_file file  
end

#default\_app\_config = YAML.load\_file(File.join(RAILS\_ROOT, ‘vendor’,  
‘plugins’, ‘config’, ‘application.yml’))  
default\_app\_config = YAML.load\_file(File.join(Rails.root, ‘config’,  
‘application.yml’))

config\_hash = (users\_app\_config||{}).reverse\_merge!  
(default\_app\_config)

unless defined?(AppConfig)  
::AppConfig = OpenStruct.new config\_hash  
else  
orig\_hash = AppConfig.marshal\_dump  
merged\_hash = config\_hash.merge(orig\_hash)

```
AppConfig = OpenStruct.new merged_hash

```

end  
end

Results in

Booting Mongrel  
=\> Rails 2.3.5 application starting on [http://0.0.0.0:3000](http://0.0.0.0:3000)  
/Library/Ruby/Gems/1.8/gems/desert-0.5.3/lib/desert/rails/  
dependencies.rb:15:in `load_missing_constant': Constant AppConfig from app_config.rb not found (NameError) from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/ active_support/dependencies.rb:80:in `const\_missing\_not\_from\_s3\_library’  
from /Library/Ruby/Gems/1.8/gems/aws-s3-0.6.2/lib/aws/s3/  
extensions.rb:206:in `const_missing' from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/ active_support/dependencies.rb:92:in `const\_missing’  
from /Users/me/Desktop/codes/apache2/rubydocs/portal/config/  
initializers/mce\_options.rb:1  
from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/  
active\_support/dependencies.rb:145:in  
`load_without_new_constant_marking' from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/ active_support/dependencies.rb:145:in `load\_without\_desert’  
from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/  
active\_support/dependencies.rb:521:in `new_constants_in' from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/ active_support/dependencies.rb:145:in `load\_without\_desert’  
from /Library/Ruby/Gems/1.8/gems/desert-0.5.3/lib/desert/ruby/  
object.rb:18:in `load' from /Library/Ruby/Gems/1.8/gems/desert-0.5.3/lib/desert/ruby/ object.rb:32:in `\_\_each\_matching\_file’  
from /Library/Ruby/Gems/1.8/gems/desert-0.5.3/lib/desert/ruby/  
object.rb:17:in `load' from /Library/Ruby/Gems/1.8/gems/rails-2.3.5/lib/initializer.rb: 622:in `load\_application\_initializers’  
from /Library/Ruby/Gems/1.8/gems/rails-2.3.5/lib/initializer.rb:  
621:in `each' from /Library/Ruby/Gems/1.8/gems/rails-2.3.5/lib/initializer.rb: 621:in `load\_application\_initializers’  
from /Library/Ruby/Gems/1.8/gems/rails-2.3.5/lib/initializer.rb:  
176:in `process' from /Library/Ruby/Gems/1.8/gems/rails-2.3.5/lib/initializer.rb: 113:in `send’  
from /Library/Ruby/Gems/1.8/gems/rails-2.3.5/lib/initializer.rb:  
113:in `run' from /Users/me/Desktop/codes/apache2/rubydocs/portal/config/ environment.rb:5 from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem\_original\_require’  
from /Library/Ruby/Site/1.8/rubygems/custom\_require.rb:31:in  
`require' from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/ active_support/dependencies.rb:156:in `require’  
from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/  
active\_support/dependencies.rb:521:in `new_constants_in' from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.5/lib/ active_support/dependencies.rb:156:in `require’  
from /Library/Ruby/Gems/1.8/gems/rails-2.3.5/lib/commands/server.rb:  
84  
from /Library/Ruby/Site/1.8/rubygems/custom\_require.rb:31:in  
`gem_original_require' from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require’  
from /Users/me/Desktop/codes/apache2/rubydocs/portal/script/server:3  
from -e:1:in `load’  
from -e:1

Process finished with exit code 1

Anyone any idea how I could fix this or any point in the right  
direction?  
It seems to have something to do with desert plugin, it also seems  
app\_config.rb is non existant

---

<div class="post-metadata">

**Author:** ![rubybox](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/85e7bf/32.png) [@rubybox](https://www.ruby-forum.com/u/rubybox)\
**Post date:** [May 29, 2010, 7:12pm UTC](https://www.ruby-forum.com/t/rails-unrecoverable-error/189353/2 "2010-05-29T19:12:06Z")

</div>

After long time I found out init.rb was a plugin specific file and  
moved it to /config/initializers

I had to remove this part of the code to make it working:

#reload CE in development  
config.after\_initialize do  
if RAILS\_ENV == ‘development’  
ActiveSupport::Dependencies.load\_once\_paths =  
ActiveSupport::Dependencies.load\_once\_paths.select {|path| (path =~ /  
(community\_engine)/).nil? }  
end  
end

That part gave me an error , any idea how i could fix that? Im not  
using a vendor plugin community\_engine anymore would setting it to /  
work?  
Any suggestions on that code part?
