2012-04-28 54 views
1

昨晚去了一個全功能的應用程序睡覺。我厭倦了webrick的表現,並決定使用不同的Web服務器進行開發。我醒來並安裝了Thin。我立即收到錯誤。我無法弄清楚發生了什麼,所以我卸載了Thin並返回Webrick完成了一些任務。令我驚訝的是,錯誤仍然存​​在!導軌資源javascript模板錯誤

這裏的錯誤:

Started GET "/signin" for 127.0.0.1 at 2012-04-28 11:01:28 -0700 
Processing by SessionsController#new as HTML 
Rendered sessions/new.html.erb within layouts/application (2.0ms) 
Compiled application.js (287ms) (pid 2928) 
Completed 500 Internal Server Error in 868ms 

ActionView::Template::Error (cannot load such file -- ["ok","(function() {\n\n\n\n}).call(this);\n"] 

(in E:/[my app's directory]/app/assets/javascripts/admins.js.coffee)): 
13: <meta name="viewport" content="width=1024, maximum-scale=1.0"> 
14: <%= stylesheet_link_tag "application", :debug => Rails.env.development? %> 
15: <%= yield :headercss %> 
16: <%= javascript_include_tag "application", :debug => Rails.env.development? %> 
17: <%= yield :headerjs %> 
18: <%= csrf_meta_tags %> 
19: </head> 

app/views/layouts/application.html.erb:16:in `_app_views_layouts_application_html_erb__960238137_43581456' 
config/initializers/quiet_assets.rb:5:in `call_with_quiet_assets' 

Rendered C:/Ruby193/lib/ruby/gems/1.9.1/gems/actionpack-3.1.3/lib/action_dispatch/middleware/templates/rescues/_trace.erb (1.0ms) 
Rendered C:/Ruby193/lib/ruby/gems/1.9.1/gems/actionpack-3.1.3/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (1.0ms) 
Rendered C:/Ruby193/lib/ruby/gems/1.9.1/gems/actionpack-3.1.3/lib/action_dispatch/middleware/templates/rescues/template_error.erb within rescues/layout (7.0ms) 

我試圖預編譯......我得到了同樣的問題。它正在嘔吐在我的javascript_include_tag上......這讓我瘋狂。它正在尋找admins.js.coffee文件...如果我刪除它,它會在下一個JavaScript文件中引發錯誤。我完全困惑,請幫助!有人幫忙! :D

+1

我沒有使用過薄過,但假設它是一個寶石,你把它添加到您的Gemfile,這是可能的,當你跑了捆綁安裝它,要麼在JS運行時您正在使用或咖啡-rails gem已更新,並且您遇到了錯誤。 現在,我不是100%確定的,但我想我記得在使用ruby 1.9.2而不是1.9.1的Windows上有更好的穩定性。你可以發佈你的Gemfile,所以我們可以看到細節和你使用的是什麼運行時? – agmcleod 2012-04-29 02:27:24

回答

0

哇。我只是浪費了5個小時的生命。在瘋狂地處理瘋狂故事之後......我絕望地開始做奇怪的事情......我最終將我的所有.coffee文件剪切並粘貼到assets/javascripts文件夾中,然後粘貼回去,一切正常!是的,我清除了我的tmp緩存,資產緩存和每個緩存,我可以想到緩存...... wtf !!!!

0

謝謝你問這個問題和agmcleod指向正確的方向... 已經開始嘗試升級到3.2後出現此錯誤,並試圖找出有罪js部分爲最後幾天:)

execjs和咖啡腳本源已最近升級,但不咖啡腳本

coffee-rails (3.1.1) 
    coffee-script (>= 2.2.0) 
    railties (~> 3.1.0) 
coffee-script (2.2.0) 
    coffee-script-source 
    execjs 
**coffee-script-source (1.2.0)** 
**execjs (1.3.0**) 
    multi_json (~> 1.0) 

包括的Gemfile這些確切的版本解決了這個問題對我來說,希望它可以幫助你,因爲我們二。

乾杯