Following the tutorial at Getting Started with Rails — Ruby on Rails Guides I am getting a rather
odd error:
,----
| ExecJS::RuntimeError in Home#index
|
| Showing /home/me/ruby/demo/app/views/layouts/application.html.erb where
| line #6 raised:
|
|
| (in /home/me/ruby/demo/app/assets/javascripts/home.js.coffee)
|
| Extracted source (around line #6):
|
| 3:
| 4: Demo
| 5: <%= stylesheet_link_tag “application”, :media => “all” %>
| 6: <%= javascript_include_tag “application” %>
| 7: <%= csrf_meta_tags %>
| 8:
| 9:
|
| Rails.root: /home/me/ruby/demo
| Application Trace | Framework Trace | Full Trace
|
| app/views/layouts/application.html.erb:6:in
| _app_views_layouts_application_html_erb___725743283_1058538740' ----
The blank line in this post below “line #6 raised” isn’t blank in the
original, it’s a line of “weird” characters (some “Japanese” looking,
some not).
Does anyone have any idea what might be wrong? I’m using
,----
| $ ruby -v
| ruby 1.8.7 (2012-06-29 patchlevel 370) [i386-cygwin]
| $ rails -v
| Rails 3.2.6
`----
for what it’s worth.
–
Gary Please do NOT send me ‘courtesy’ replies off-list.
isn’t blank in the original, it’s a line of “weird” characters (some
“Japanese” looking, some not).
Did you try to repeat your actions with ruby 1.9.2 or 1.9.3? I think
it
may works.
The issue may be in utf-8 encoding
It was, thank you.
And I now get
,----
| Processing by HomeController#index as HTML
| Rendered home/index.html.erb within layouts/application (46.9ms)
| Completed 500 Internal Server Error in 1484ms
|
| ActionView::Template::Error ("\n"
| (in /home/me/ruby/demo/app/assets/javascripts/home.js.coffee)):
| 3:
| 4: Demo
| 5: <%= stylesheet_link_tag “application”, :media => “all” %>
| 6: <%= javascript_include_tag “application” %>
| 7: <%= csrf_meta_tags %>
| 8:
| 9:
| app/views/layouts/application.html.erb:6:in
| _app_views_layouts_application_html_erb___129363260_1057547720' | | | Rendered | /home/me/.gemrepo/gems/actionpack-3.2.6/lib/action_dispatch/middleware/templates/rescues/_trace.erb | (0.0ms) | Rendered | /home/me/.gemrepo/gems/actionpack-3.2.6/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb | (15.6ms) | Rendered | /home/me/.gemrepo/gems/actionpack-3.2.6/lib/action_dispatch/middleware/templates/rescues/template_error.erb | within rescues/layout (78.1ms)----
the error being shown in the browser being “Iconv::InvalidCharacter in
Home#index”. So it still seems to be some kind of encoding issue,
somewhere, but having explicitly encoded all of the files to UTF-8, I
don’t understand where the problem lies, nor why iconv is getting
involved.
–
Gary Please do NOT send me ‘courtesy’ replies off-list.