rails app in development mode gives internal server error and not the usual error page with trace. no info in log/development.log either. no matter what server. on any request.
What is wrong?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
syntax error caused by invalid character coding under ruby 1.9. most likely you used utf-8 when ruby (and rails) expects ASCII by default in source files. (yeah, right?)
solution is to use BOM http://www.w3.org/International/questions/qa-byte-order-mark or put
or
on top of files in utf-8.
To set
UTF-8globally, you can putin your
config/application.rbwhich is equivalent towhich in turn is the equivalent to putting:
or a BOM at the top of every file.
This allows utf-8 globally on all files of the rails app.
If you want a global option on all ruby files, you can use the
-Eor-Kruby option and set it via theRUBYOPTenvironment variable, like:or
see http://www.manpagez.com/man/1/ruby/
see http://zargony.com/2009/07/24/ruby-1-9-and-file-encodings
There’s also gem that sets the magic comment on top on every file that needs it in a Rails project : https://github.com/m-ryan/magic_encoding