简体   繁体   中英

Precompiled assets not being used

I deployed my Rails application to an nginx server. When i go to the Page i can see the precompiled js and css assets including their fingerprints in the filename. I can also navigate to them in the browser but none of the js functions work. Neither the one that come along with CKEditor or Bootstrap-Datepicker nor the functions i've written by my self.

Safari returns ReferenceError: Can't find variable: CKEDITOR

Firefox: ReferenceError: CKEDITOR is not defined

In local development mode it works just fine. The really confusing part for me is, that the precompiled css is working perfectly.

I'm using coffeScript with the coffee-rails gem (v. 4.1.1) and jquery-rails (v 4.1.0)

For the deploy i use capistrano (v 3.4.0)

Rails version is 4.2.4

Never mind after reordering the required files in app/assets/javascript/application.js the error was no longer there.

Before i had:

//= require jquery
//= require jquery_ujs
//= require turbolinks
//= require_tree .
//= require bootstrap-datepicker
//= require ckeditor/init

And now the working order is:

//= require jquery
//= require jquery_ujs
//= require turbolinks
//= require ckeditor/init
//= require_tree .
//= require bootstrap-datepicker

So I moved the //= require ckeditor/init above the //= require_tree .

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