Getting following error while upgrading to Rails 3.1.0.rc5
Solution to fix the problem:
Change RAILS_ROOT to Rails.root
NameError (uninitialized constant Search::RAILS_ROOT):
app/models/search.rb:159:in `run'
app/controllers/searches_controller.rb:66:in `new'
Rendered highline/ruby/1.9.1/bundler/gems/rails-30dae273c85a/actionpack/lib/action_dispatch/middleware/templates/rescues/_trace.erb (1.2ms)
Rendered highline/ruby/1.9.1/bundler/gems/rails-30dae273c85a/actionpack/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (0.9ms)
Rendered highline/ruby/1.9.1/bundler/gems/rails-30dae273c85a/actionpack/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (35.6ms)
Solution to fix the problem:
Change RAILS_ROOT to Rails.root
thanks.. this helps me instantly..
ReplyDeleteRails.root is working fine in controller. But it is giving me a error that " undefined method `root' ". Please help
ReplyDeleteDeepak, where it is giving error that " undefined method `root' " (in view, model, controller). Which version of rails you are using?
ReplyDelete