简体   繁体   中英

Rails: some javascript not working in production ONLY on a Windows computer

I'm currently working on a rails web app that I'm hosting on a DigitalOcean server.

It runs on ruby 2.5.1 and rails 5.2.0.

When I access the website on Chrome or Firefox on my Linux machine, it works perfectly fine. Same on an Android device. But when I access it on a Windows computer, some JavaScript plugins and gems are not working.

For example, I'm using Trumbowyg as a wysiwyg editor, bootstrap-datetimepicker and font awesome and none of them are working, while some other JavaScript plugins seem to work, like bootstrap.

I checked on the Chrome console and all the code seem to be included in the application.js file in both Linux and Windows. On Windows, the console doesn't recognize my plugins, where on linux it does. In both systems, jQuery is working properly.

I don't understand how it can work on Android and Linux but not on Windows.

Does anyone have some ideas on how to fix this ?

I managed to fix this by creating a new manifest file and importing all my JavaScript modules and coffee files in it.

I included it in my layout and added it to the assets.rb file for precompilation.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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