Javascript功能在localhost上工作,但在部署到Heroku时不能使用 [英] Javascript features work on localhost but not when deployed to Heroku

查看:112
本文介绍了Javascript功能在localhost上工作,但在部署到Heroku时不能使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我注意到,当我部署到Heroku时,javascript功能不起作用(比如Bootstrap Popover,Buttons等)。我正在使用rails 3.2.2,ruby 1.9.3。这些功能在localhost上运行。在部署到Heroku时似乎没有显示任何错误(功能根本不显示)。

I've noticed that when I deploy to Heroku, javascript features dont work (such as Bootstrap Popover, Buttons, etc). I'm working with rails 3.2.2, ruby 1.9.3. The features work on localhost. There appear to be no errors displayed when deployed to Heroku (the features simply don't show up).

任何想法?感谢!

推荐答案

我也有类似的问题,但问题也发生在本地主机上。

I also had similar problem but the problem was happening on localhost as well.

您可能正在使用rails-bootstrap gem。它安装一个文件bootstrap.coffee.js这个文件是罪魁祸首。它有.popover使用和相关的插件不包括在内。我评论说,因为我没有使用它,但你应该考虑包括popover插件引导。

You are probably using rails-bootstrap gem. It installs a file bootstrap.coffee.js This file was culprit. It had .popover use and relevant plugin was not included. I commented that out as I was not using it anyway but you should consider including the popover plugin for bootstrap.

这篇关于Javascript功能在localhost上工作,但在部署到Heroku时不能使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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