没有加载生产中的Ratyrate明星(heroku) [英] Ratyrate stars not loading in production (heroku)

查看:108
本文介绍了没有加载生产中的Ratyrate明星(heroku)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,我通过添加

 <%= javascript_include_tag'ratyrate.js', data-turbolinks-track=>假%> 

到我的视图的正文。在此之前,星星只会在直接访问网址或刷新网页时加载。



现在当我在Heroku上部署我的应用程序时,我遇到了完全相同的问题(当通过链接访问页面时,未加载星星)



我希望这是足够的信息(乐意提供更多信息),并且有人遇到过这种情况/有任何想法!谢谢!



解答 - 见答案

所以问题是我忘记运行 rake assets:precompile 。这个问题中提到的开发解决方案应该是可行的。



解决方案

<%= javascript_include_tag'ratyrate.js',data-turbolinks-track=>假的%> 头部(似乎运行得更快)或身体标记在你的看法。

还要添加 Rails.application.config.assets.precompile + =%w(ratyrate.js)
改为 config / initializers / assets.rb



然后确保你运行 rake assets:precompile ,以免看起来像我一样愚蠢!



希望这有助于某人:)

So ive got ratyrate working in development just fine by adding

<%= javascript_include_tag 'ratyrate.js', "data-turbolinks-track" => false %>

to the body of my view. Prior to this the stars would only load when the url was directly accessed or the page refreshed.

Now I am having the exact same issue (stars not loading when page is accessed through a link) when deploying my app on heroku!

I hope that this is enough info (happy to provide more) and that someone has faced this before/has any ideas! Thanks!

solved - see answer

解决方案

So the problem was that I forgot to run rake assets:precompile. The solution for development mentioned in the question should work.

SOLUTION

Add <%= javascript_include_tag 'ratyrate.js', "data-turbolinks-track" => false %> to the head (seems to run faster) or body tag in your view.

Also add Rails.application.config.assets.precompile += %w( ratyrate.js ) to config/initializers/assets.rb.

Then make sure you run rake assets:precompile to avoid looking as silly as me!

Hope this helps someone :)

这篇关于没有加载生产中的Ratyrate明星(heroku)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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