2

I've got problem with migrating rails 2.x -> 3.2.13 At some point, after fixing a few things, I get Completed 500 Internal Server Error in 76ms without any traceback.

development.rb

config.consider_all_requests_local       = true
config.action_controller.perform_caching = false

Why there is no traceback and how to fix this?

Kiro
  • 920
  • 10
  • 24
  • 2
    You should not upgrade 2.x to 3.2.x. You should first migrate to 3.0.x and then 3.2.x. Jumping too many versions is bound to create issues. – Alex Peachey Jun 03 '13 at 07:19

1 Answers1

4

you probably solved it but I wanted to share my couple of hours debugging about this issue as it can be very annoying. In short, I was having the same problem - 500 internal server error without any log of the exception thrown. It was happening only for exceptions thrown in the action view templates - any ActionView::Template::Error exception. For example, missing partial, invalid route.

My specific problem was using this ruby statistics module:

http://derrick.pallas.us/ruby-stats/

directly in the initializers directory which works great in rails 2.x. It defined Array.sum method which is already defined in rails 3 under Enumerable.sum. The problem with the redefine is that Array.sum no longer works with arrays of strings which is what rails was trying to do with ActionView::Template::Error.source_extract method - when trying to extract the source of the error in template, it uses the Enumerable.sum method which is redefined in a wrong way. Thus, another exception happened TypeError: cannot convert String into Fixnum and the original exception was not logged, neither was the new one. I had to do a backtrace and go through many of the internal calls to see where is the issue.

So, for everyone not seeing the actual exceptions thrown in your ActionView templates, check if you have not redefined a rails method that is used internally in rails.

kroky
  • 1,266
  • 11
  • 19
  • You right, I solved it, but it wasn't exactly that. I didn't define files (*.rb) encoding, and that was the problem. At some point, rails has to catch this error (I have no idea why, probably it's a bug) without giving me any traceback, only 500 error. But thanks for your answer, it's very similar issue. – Kiro Jul 02 '13 at 09:03
  • I commented out each gem in my dev group until error messages started appearing again on logs and the browser. Thanks a million. I found web-console gem was causing it. The gem must have been over writing a Rails method. – Natus Drew May 10 '17 at 01:07