Pregunta

When I run my little app on my local system everything works fine. When I move to production I get the error 500 message (We're sorry, but something went wrong.). My production.log fiel is showing this:

Started GET "/" for 79.203.113.136 at 2012-11-13 13:54:06 +0100
Processing by DayviewController#index as HTML
  Rendered dayview/index.html.erb within layouts/application (0.4ms)
Completed 500 Internal Server Error in 1783ms

ActionView::Template::Error (TypeError: Cannot call method 'write' of undefined
at /tmp/execjs20121113-27948-1cczq8s.js:5043:20
at /tmp/execjs20121113-27948-1cczq8s.js:5057:16
at /tmp/execjs20121113-27948-1cczq8s.js:1:92
at Object.<anonymous> (/tmp/execjs20121113-27948-1cczq8s.js:1:109)
at Module._loadContent (node.js:667:21)
at node.js:695:20
at node.js:304:23
at node.js:756:9

(in /home/www/pvdaheim/app/assets/javascripts/jquery-1.8.2.min.js)):
5:   <%= stylesheet_link_tag    "application", :media => "all" %>
6:   <%= javascript_include_tag "application" %>
7:   <%= javascript_include_tag :defaults %>  
8:   <%= javascript_include_tag "jquery-1.8.2.min", "jquery-ui-1.8.23.custom.min", "jquery.ui.datepicker", "rails", "highcharts", "highstock" %>
9:   <%= csrf_meta_tags %>
10: </head>
11: <body>
 app/views/layouts/application.html.erb:8:in `_app_views_layouts_application_html_erb___1022895261_93021610'

I don't have a file called /tmp/execjs20121113-27948-1cczq8s.js. I found some similar issues in the forum but none of them was helpful for me to fix mine.

Thanks & Regards, Andreas

Here is my index.html.erb:

<div id="container2" style="height:500px; background-color:#999999; border:thin solid">
</div>

<script type="text/javascript" src="./pv_andreas/wr.js"></script>?
<script type='text/javascript'>//<![CDATA[ 

$(function() {
    var chart = new Highcharts.StockChart({
    ... highstock stuff rendered to container2...
});
//]]>
</script>

And here is my routes.rb:

Pvdaheim::Application.routes.draw do
  get "dayview/index"
  root :to => 'dayview#index'
end
¿Fue útil?

Solución

Remove get "dayview/index" in your routes file and it will work.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top