2012-03-24 23 views
3

即時通過我在heroku部署問題! 我剛剛創建的雪松堆棧的應用測試,把我的應用程序,我有這個問題(日誌)操作視圖::模板::錯誤(意外的標記:操作符(<))

←[32m2012-03-24T15:10:56+00:00 app[web.1]:←[0m ActionView::Template::Error (Unexpected token: operator (<) 
←[32m2012-03-24T15:10:56+00:00 app[web.1]:←[0m (in /app/app/assets/javascripts/application.js)): 
←[32m2012-03-24T15:10:56+00:00 app[web.1]:←[0m  3: <head> 
←[32m2012-03-24T15:10:56+00:00 app[web.1]:←[0m  4: <title>Test</title> 
←[32m2012-03-24T15:10:56+00:00 app[web.1]:←[0m  5: <%= stylesheet_link_tag "application" %> 
←[32m2012-03-24T15:10:56+00:00 app[web.1]:←[0m  6: <%= javascript_include_tag "application" %> 
←[32m2012-03-24T15:10:56+00:00 app[web.1]:←[0m  7: <%= csrf_meta_tags %> 
←[32m2012-03-24T15:10:56+00:00 app[web.1]:←[0m  8: </head> 
←[32m2012-03-24T15:10:56+00:00 app[web.1]:←[0m  9: <body> 

任何想法?

更新

我的application.js文件

// This is a manifest file that'll be compiled into including all the files listed below. 
// Add new JavaScript/Coffee code in separate files in this directory and they'll automatically 
// be included in the compiled file accessible from http://example.com/assets/application.js 
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the 
// the compiled file. 
// 
//= require jquery 
//= require jquery_ujs 
//= require jquery-ui 
//= require_tree . 
+0

它可以在本地機器上以生產模式*(使用資源預編譯)正常工作嗎?/app/assets/javascript目錄下是否有非js/coffee文件? – pjumble 2012-03-24 18:08:10

+0

可能在'application.js'中發生一些奇怪的事情。你有沒有檢查它在localhost中正常工作? – 2012-03-24 16:15:32

+0

是的,在我的本地服務器應用程序工作正常。 – 2012-03-24 18:00:05

回答

0

我剛剛碰到這個問題,訣竅是,有服務器之間的衝突的剩餘線我的本地主機。在我的本地主機中,一切都很好,但我認爲這是因爲某些緩存或其他東西。無論如何,我打開的application.js並刪除與< < HEAD行...

我讓它這裏問題的寄存器和可能的解決方案

0

我就遇到了這個錯誤,並花了同時找出清單中引用的文件是罪魁禍首。一旦我想通了,哪個文件是導致錯誤,搜索「>」拉幾行,但我很幸運,在其使用的=>運營商的地圖功能快速歸零:

.map(x => x.id);

有一次,我改變了一個匿名函數:

.map(function(x) { return x.id; });

錯誤就走開了。