Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to prevent Rails 2.3.8 from checking all dependencies while loading
    text
    copied!<p>I have a rails 2.3.8 app which can be started without database. so in the environment.rb file i exclude ActiveRecord and in the application controller i render different pages when ActiveRecord is not defined. But when i try to upgrade mongral to passenger, passenger throws an Error </p> <blockquote> <p>uninitialized constant ActiveRecord</p> </blockquote> <p>The control is not going to the application controller at all. How can i make passenger not raise this exception.?</p> <p>Attached the stacktrace</p> <p><a href="http://pastebin.com/1kXDwiRT" rel="nofollow">http://pastebin.com/1kXDwiRT</a></p> <p>in abuses.rb i have </p> <blockquote> <p>class Abuse &lt; ActiveRecord::Base<br> acts_as_paranoid</p> <p>belongs_to :user belongs_to :review validates_presence_of :type, :message => _('cannot be blank')<br> validates_presence_of :user, :on => :create, :if => Proc.new { |r| r.visitor_id == nil}<br> validates_presence_of :visitor_id, :on => :create, :if => Proc.new { |r| r.user_id == nil}<br> validates_length_of :comment, :maximum => 2000, :message => _('is too long 2000')</p> <p>end</p> </blockquote> <p>I cannot remove this model classes because they will be used when i start the website with ActiveRecord. I want to start the website without ActiveRecord in some emergency situation where the db is down. and i ll show the pages which doesnt database.</p> <p>After further more researching i found that in intializer.rb file i have this function</p> <blockquote> <p>def load_application_classes return if $rails_rake_task if configuration.cache_classes configuration.eager_load_paths.each do |load_path| matcher = /\A#{Regexp.escape(load_path)}(.*).rb\Z/ Dir.glob("#{load_path}/*<em>/</em>.rb").sort.each do |file| require_dependency file.sub(matcher, '\1') end end end end</p> </blockquote> <p>commenting out the require_dependency line, makes the rails not to check Dependency of each and every file. Is there any way to disable this from the environment.rb config file? setting config.cache to false is working. but i want to cache the classes. but only not check the dependency.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload