All out of the sudden, even after replacing my app I get an error like:
!! Unexpected error while processing request: undefined method `show' for "/":String
I have replaced my code with a backup from a few hours earlier, I test my app continuously when I'm building new features also by opening browser and clicking true pages, the old code from backup worked flawlessly but now i cannot get my app to work anymore
help! any more advanced ruby on rails coders can help me fix this? thx
Full output of rails/server not the log!
/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
Things tried
The solution and a lesson learned
I had a custom initializer for logging not the assets, this one messed up somehow it broke in the upgrade to latest ruby on rails version. Always check /config/ and initializers before the app code if you get this kind of strange behavior ;p
I know that this is an old answer, but I came across a similar error message recently.
I was able to get crystal-clear stack traces from Thin by upgrading from version 1.5 -> 1.6.1, which provides much more complete logging of issues at the middleware level.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With