I have encountered a strange error message when I try to load certain pages of my site (most pages, actually) on my test production server.
Started GET "/students" for 10.0.0.68 at Mon Sep 17 12:53:16 +0100 2012
Processing by StudentsController#index as HTML
Rendered shared/_alerts.html.erb (0.7ms)
Rendered students/_student_search.html.erb (0.0ms)
Rendered students/index.html.erb within layouts/application (17.8ms)
Completed 500 Internal Server Error in 92ms
ActionView::Template::Error (syntax error on line 4, col 586: ` state: ["北海道","青森県","岩手県","宮城県","秋田県","山形県","福島県","茨城県","栃木県","群馬県","埼玉県","千葉県","東京都","神奈川県","新潟県","富山県","石川県","福井県","山梨県","長野県","岐阜県","静岡県","愛知県","三重県","滋賀県","京都府","大阪府","兵庫県","奈良県","和歌山県","鳥取県","島根県","岡山県","広島県","山口県","徳島県","香川県","愛媛県","高知県","福岡県","佐賀県","長崎県","熊本県","大分県","宮崎県","鹿児島県","沖縄県"]'):
59: <% end %>
60:
61: <div class="sidebar_item">
62: <h2>Filter By <%= t(:class) %></h2>
63: <div class="content">
64:
65: <% if Klass.where(:tutor_group => false).count > 0 %>
app/views/students/index.html.erb:62:in `_app_views_students_index_html_erb___542210558__648905548'
app/views/students/index.html.erb:35:in `_app_views_students_index_html_erb___542210558__648905548'
Whichever page it happens on the error message is always the same (same line and col numbers) but the filenames are different and the quoted code changes too. As far as I know or can see there are none of these japanese characters anywhere in my code. It seems like some encoding issue or something but I really have no idea and I don't know where to begin to debug it.
My env:
deploy@mike-test:~$ ruby -v
ruby 1.8.7 (2010-08-16 patchlevel 302) [i686-linux]
deploy@mike-test:~$ rails -v
Rails 3.2.0
deploy@mike-test:~$ gem -v
1.8.15
deploy@mike-test:~$ /opt/nginx/sbin/nginx -V
nginx version: nginx/1.2.3
built by gcc 4.5.2 (Ubuntu/Linaro 4.5.2-8ubuntu4)
TLS SNI support enabled
configure arguments: --prefix=/opt/nginx --with-http_ssl_module --with-http_gzip_static_module --with-cc-opt=-Wno-error --with-pcre=/tmp/root-passenger-16778/pcre-8.31 --add-module=/usr/local/lib/ruby/gems/1.8/gems/passenger-3.0.17/ext/nginx
deploy@mike-test:~$ passenger -v
Phusion Passenger version 3.0.17
Ubuntu is 11.04.
Update: OK, I narrowed the problem down somewhat. Figured out it's to do with the method call t(:class), which is a rails helper method for translation, and that appears in my views quite a bit (I'm new to this app, so still getting my head around how it's written). Judging by the two locale files that are present, this is meant to return either 'School', or 'Class' depending on the locale setting. What I still don't know is why it is causing this error, though.