Updating rails to 3.1.1 i get uninitialized consta

2019-06-16 03:34发布

问题:

After updating from 3.0.1 to 3.1.1 my application according the relevant railscast i seem to get this:

uninitialized constant Product::RAILS_ROOT

Product is my main object

回答1:

Try this instead:

Rails.root

add to_s if you need it as a string!



回答2:

RAILS_ROOTno longer exists. Use Rails.root instead.