Heroku崩溃与Rails 5 rc1 [英] Heroku crashing with Rails 5 rc1

查看:73
本文介绍了Heroku崩溃与Rails 5 rc1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经从4滑轨升级到5滑轨.太好了.添加了Foundation 6顶栏,并已推送到heroku.一切顺利,但网站未加载. heroku run logs显示了此内容:

I have upgraded from rails 4 to 5. Great. Added Foundation 6 topbar, pushed to heroku. Nothing failed but website not loading. heroku run logs showed this:

<div class="title-bar" data-responsive-toggle="example-menu" data-hide-for="medium">
  <button class="menu-icon" type="button" data-toggle></button>
  <div class="title-bar-title">
    <%= image_tag("o-section/mascot.svg") %>
  </div>
</div>

错误是:

ActionView :: Template :: Error(意外令牌标记​​«(»,预期标记«:»(行:23041,col:10,pos:685332)错误

ActionView::Template::Error (Unexpected token punc «(», expected punc «:» (line: 23041, col: 10, pos: 685332) error

这里有问题吗?

推荐答案

让我关闭它.在添加新图像之前,我无法解释为什么它会起作用或曾经起作用,但是...它起作用.

Let me close this. I can't explain why this works or used to work before adding a new image but...it works.

回顾该错误,它与javascript函数有关.我不知道line: 23041或在哪里,但是我想那是来自编译文件.长话短说,我所有的js函数看起来都像这样:

Looking back at the error, it was relating to a javascript function. I do not know what or where is line: 23041 but I guess that is from a compiled file. So for a long story short, all my js functions looked something like this:

foo() {
 ...
}

然后我想知道,如果将所有内容都更改为香草js函数"该怎么办.:

I then wondered, what if I changed all to a "vanilla js function".:

foo: function() {
 ...
}

因此,基本上,线索是expected punc «:»,其中需要foo: function(){...}

So basically the clue was expected punc «:» in which it wanted foo: function(){...}

此后,我rake asset:precompile一切都很好.

这篇关于Heroku崩溃与Rails 5 rc1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆