简体   繁体   English

heroku它的调用javascript代码,它不在我的ruby on rails项目中

[英]heroku its calling javascript code that its not in my project of ruby on rails

as the tittle said i have a lot of javascript that its not in the project, i have in the project before but now i dont use them anymore so i stop calling them in the application.js and in my test heroku server it works but in my main server its not! 正如标题所说,我有很多不在项目中的javascript,我以前在项目中有,但是现在我不再使用它们了,所以我不再在application.js中调用它们,而在我的测试heroku服务器中,它起作用了,但是我的主服务器不是! and i dont know why. 而且我不知道为什么。

test server: morning-shelf-6185.herokuapp.com.
run server: www.apptrendit.com.

if you compare the 2 application.js the code are a lot different. 如果比较2 application.js,代码会大不相同。

test server: https://morning-shelf-6185.herokuapp.com/assets/application-5c4208e2bfaa870785d03c0aa2febd5c.js
run server: https://morning-shelf-6185.herokuapp.com/assets/application-5c4208e2bfaa870785d03c0aa2febd5c.js

i use heroku for the both of them but 1 of them is a development server and the other is a master server but the 2 of them have the same code and files when i see it with my sublime text 我对两个都使用heroku,但是其中一个是开发服务器,另一个是主服务器,但是当我看到其崇高的文字时,它们中的2个具有相同的代码和文件

Your problem is probably related to the assets pipeline. 您的问题可能与资产管道有关。

You may want to run RAILS_ENV=production rake assets:precompile before deploying to your main server. 在部署到主服务器之前,您可能需要运行RAILS_ENV=production rake assets:precompile If you use capistrano you can automate the process. 如果您使用capistrano ,则可以自动化该过程。

Everytime u make a huge change on your assets do this: 每当您对资产进行巨额更改时,请执行以下操作:

bundle exec rake assets:precompile

in local and then just add, commit and push it. 在本地,然后只需添加,提交和推送即可。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM