Why get empty CSS files in Production?

I have added many css files to the active_admin.css.scss file:

// Active Admin got SASS!
@import "active_admin/mixins";
@import "active_admin/base";
@import "admin/plugins/*";
@import "admin/calendar";
@import "jquery-ui.css";
@import "admin/jquery.datepick.css";

But the files "jquery-ui.css"and "admin/jquery.datepick.css"create problems. I get a 404 Not Found error in the browser console below:

http://staging.xxx.com/assets/jquery-ui.css
http://staging.xxx.com/assets/admin/jquery.datepick.css

I also checked assets in browsers, these 2 files are present, but they have no content inside it. I use Nginx as my web server in Ec2. Everything works in development, but not in production.

My Ngnix is ​​configured as indicated in this answer . I use Capistranofor deployment. Everything works, but not these 2 files.

I also have the following settings in production.rb:

config.assets.compile = true
config.assets.precompile += %w[active_admin.css active_admin.js]

And yet it did not work. I found the above suggestion from here .

+4
source
2

@import. :

@import "jquery-ui";
@import "admin/jquery.datepick";
+1

, , , "", .

- , , , . .precompile production.rb, assets.rb :

# assets.rb
# Be sure to restart your server when you modify this file.

# Precompile additional assets.
# application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
Rails.application.config.assets.precompile += %w( mapworkers.js )
Rails.application.config.assets.precompile += %w( prototype.js )

production.rb

# production.rb
# Disable Rails static asset server (Apache or nginx will already do this).
config.serve_static_files = false

# Compress JavaScripts and CSS.
config.assets.js_compressor = :uglifier

# Do not fallback to assets pipeline if a precompiled asset is missed.
config.assets.compile = false

# Generate digests for assets URLs.
config.assets.digest = true

:. wth 65k rep, , , , , Rails - Nginx Unicorn. , , , , Capistrano. , , Capistrano , , , , Cap , -.

+1

All Articles