Rub*_*tic 4 ruby-on-rails ruby-on-rails-3 ruby-on-rails-3.2
所有突然之间,甚至在更换我的应用程序后,我得到一个错误,如:
!! Unexpected error while processing request: undefined method `show' for "/":String
Run Code Online (Sandbox Code Playgroud)
我已经用几个小时之前的备份替换了我的代码,当我通过打开浏览器并单击真实页面来构建新功能时,我不断测试我的应用程序,来自备份的旧代码完美无缺但现在我无法将我的应用程序运行到工作了
救命!在轨道编码器上任何更高级的红宝石可以帮我解决这个问题吗?谢谢
rails/server的完整输出不是日志!
/Users/jordan/.rvm/rubies/ruby-1.9.3-p194/bin/ruby -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) /Users/jordan/apps/books/script/rails server -b 0.0.0.0 -p 3000 -e development
=> Booting Thin
=> Rails 3.2.3 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
>> Thin web server (v1.3.1 codename Triple Espresso)
>> Maximum connections set to 1024
>> Listening on 0.0.0.0:3000, CTRL+C to stop
!! Unexpected error while processing request: undefined method `show' for "/":String
!! Unexpected error while processing request: undefined method `show' for "/":String
!! Unexpected error while processing request: undefined method `show' for "/":String
!! Unexpected error while processing request: undefined method `show' for "/":String
!! Unexpected error while processing request: undefined method `show' for "/profiles":String
!! Unexpected error while processing request: undefined method `show' for "/about":String
Run Code Online (Sandbox Code Playgroud)
事情尝试了
解决方案和吸取的教训
我有一个自定义初始化程序,用于记录而不是资产,这个搞砸了它在升级到rails版本的最新ruby时破坏了.如果您遇到这种奇怪的行为,请务必在应用代码之前检查/ config /和初始值设定项; p