首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Rails应用程序一旦部署到heroku,就不会加载Arbor.js

Rails应用程序一旦部署到heroku,就不会加载Arbor.js
EN

Stack Overflow用户
提问于 2014-07-31 14:54:59
回答 1查看 85关注 0票数 0

我们正在构建一个rails应用程序,并使用Arbor.js在rails应用程序的网页上显示节点图,它在本地主机上运行良好,但是当我们部署时,我们会得到以下错误。

代码语言:javascript
复制
Resource interpreted as Script but transferred with MIME type text/html: "http://www.thoughtly.io/users/9/categories". 29:11
Refused to execute script from 'http://www.thoughtly.io/public/assets/arbor.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled. 29:1
arbor.js/web-workers 
Object {integrator: "verlet", repulsion: 1000, stiffness: 30, friction: 40, dt: 0.02…}
 VM414:1
Resource interpreted as Script but transferred with MIME type text/html: "http://www.thoughtly.io/users/9/categories". application-7588a131d5b5b403e30855abe426e8c5.js:11681
physics: 
ErrorEvent {error: null, colno: 1, lineno: 1, filename: "http://www.thoughtly.io/public/assets/arbor.js", message: "Uncaught SyntaxError: Unexpected token <"…}

我们需要使用layout.html.erb中的脚本标记,该脚本标记如下所示:

代码语言:javascript
复制
  <script type="application/javascript" src="/public/assets/arbor.js"></script>

我很难让它在Heroku上运行,而且我找不到足够的文档。有什么想法吗?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2014-07-31 15:39:26

如果您尝试直接在浏览器中加载http://www.thoughtly.io/public/assets/arbor.js,您将被重定向到http://www.thoughtly.io/。这意味着script标记试图像解析Javascript文件一样解析一个Unexpected token <页面(这会导致Unexpected token <错误。检查控制器中的任何before_filter是否导致重定向。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/25062184

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档