2012-03-24 72 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; });

错误就走开了。