Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

rails app strange error, no trace, no log output help please seriously issue " !! Unexpected error while processing request:

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

  • Cleaned routes file
  • Restarted machine
  • Removed all gems from gem set and installed cleanly
  • Tested another ruby on rails app wich worked fine
like image 255
Rubytastic Avatar asked Feb 20 '23 06:02

Rubytastic


2 Answers

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

like image 159
Rubytastic Avatar answered Feb 22 '23 20:02

Rubytastic


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.

like image 44
Wheeyls Avatar answered Feb 22 '23 20:02

Wheeyls