简体   繁体   English

将rails更新到3.1.1我得到未初始化的常量Product :: RAILS_ROOT

[英]Updating rails to 3.1.1 i get uninitialized constant Product::RAILS_ROOT

After updating from 3.0.1 to 3.1.1 my application according the relevant railscast i seem to get this: 根据相关的railscast从3.0.1更新到3.1.1后,我的应用程序似乎得到了这个:

uninitialized constant Product::RAILS_ROOT 未初始化的常量Product :: RAILS_ROOT

Product is my main object 产品是我的主要对象

Try this instead: 试试这个:

Rails.root

add to_s if you need it as a string! 如果你需要它作为一个字符串添加to_s

RAILS_ROOT no longer exists. RAILS_ROOT不再存在。 Use Rails.root instead. 请改用Rails.root

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM