加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

ruby-on-rails – 动作视图::模板::错误(意外的标记:操作符(&lt

发布时间:2020-12-17 02:01:24 所属栏目:百科 来源:网络整理
导读:我在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.
我在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 .

解决方法

我遇到了这个错误,需要一段时间来确定清单中引用的文件是罪魁祸首.一旦我找出导致错误的文件,搜索“>”拉了几行,但我很幸运,并迅速归零地图功能,使用=>操作符:

.map(x => x.id);

一旦我将其更改为匿名函数:

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

错误消失了.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读