尝试在 heroku 中推送 rails 应用程序并出现 js 错误
Trying to push rails app in heroku and get a js error
我累了。我尝试推送我的 rails 应用程序 (User+fullCalendar),但出现错误:
This request has been blocked; the content must be served over HTTPS.
我的观点是:
<script src='http://fullcalendar.io/js/fullcalendar-2.2.0/lib/moment.min.js'></script>
<script src='http://fullcalendar.io/js/fullcalendar-2.2.0/lib/jquery.min.js'></script>
<script src="http://fullcalendar.io/js/fullcalendar-2.2.0/lib/jquery-ui.custom.min.js"></script>
<script src='http://fullcalendar.io/js/fullcalendar-2.2.0/fullcalendar.min.js'></script>
是的,https 和 http 不兼容的问题,但如果我从视图日历中删除脚本文件也将不起作用。我该怎么办?
我相信你可以像这样使用与 url 相关的协议:
<script src='//fullcalendar.io/js/fullcalendar-2.2.0/lib/moment.min.js'></script>
<script src='//fullcalendar.io/js/fullcalendar-2.2.0/lib/jquery.min.js'></script>
<script src="//fullcalendar.io/js/fullcalendar-2.2.0/lib/jquery-ui.custom.min.js"></script>
<script src='//fullcalendar.io/js/fullcalendar-2.2.0/fullcalendar.min.js'></script>
在推送到 heroku 之前,您还需要 运行 rake assets:precompile
。看这里https://devcenter.heroku.com/articles/rails-asset-pipeline
我累了。我尝试推送我的 rails 应用程序 (User+fullCalendar),但出现错误:
This request has been blocked; the content must be served over HTTPS.
我的观点是:
<script src='http://fullcalendar.io/js/fullcalendar-2.2.0/lib/moment.min.js'></script>
<script src='http://fullcalendar.io/js/fullcalendar-2.2.0/lib/jquery.min.js'></script>
<script src="http://fullcalendar.io/js/fullcalendar-2.2.0/lib/jquery-ui.custom.min.js"></script>
<script src='http://fullcalendar.io/js/fullcalendar-2.2.0/fullcalendar.min.js'></script>
是的,https 和 http 不兼容的问题,但如果我从视图日历中删除脚本文件也将不起作用。我该怎么办?
我相信你可以像这样使用与 url 相关的协议:
<script src='//fullcalendar.io/js/fullcalendar-2.2.0/lib/moment.min.js'></script>
<script src='//fullcalendar.io/js/fullcalendar-2.2.0/lib/jquery.min.js'></script>
<script src="//fullcalendar.io/js/fullcalendar-2.2.0/lib/jquery-ui.custom.min.js"></script>
<script src='//fullcalendar.io/js/fullcalendar-2.2.0/fullcalendar.min.js'></script>
在推送到 heroku 之前,您还需要 运行 rake assets:precompile
。看这里https://devcenter.heroku.com/articles/rails-asset-pipeline