1

当我在本地系统上运行我的小应用程序时,一切正常。当我开始生产时,我收到错误 500 消息(很抱歉,出现了问题。)。我的 production.log 字段显示如下:

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'

我没有名为 /tmp/execjs20121113-27948-1cczq8s.js 的文件。我在论坛中发现了一些类似的问题,但没有一个对我的修复有帮助。

谢谢和问候, 安德烈亚斯

这是我的 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>

这是我的 routes.rb:

Pvdaheim::Application.routes.draw do
  get "dayview/index"
  root :to => 'dayview#index'
end
4

1 回答 1

-1

在您的路线文件中删除get "dayview/index",它将起作用。

于 2012-11-13T20:00:43.017 回答