sstephenson / sprockets

Rack-based asset packaging system
2.55k stars 24 forks source link

sprockets broken on production mode and asset pipeline kills my app #726

Closed poc7667 closed 8 years ago

poc7667 commented 9 years ago

This is the webpage, shows the error directly, I don' think the error in assets should break my app (annoyed Rails)

The assets files works really perfectly in static.

But really troublesome to migrate into Ruby on Rails

application.rb

config.assets.paths << "#{Rails.root}/vendor/themes"
config.assets.precompile << /(^[^_\/]|\/[^_])[^\/]*$/

production.rb

  config.assets.precompile = ['*.js', '*.css', '*.css.erb']
  config.assets.js_compressor = :uglifier
  config.assets.compile = true

rake precompile

I, [2015-05-21T19:00:38.736247 #14721]  INFO -- : Writing /Users/user_a/workspace/template/kyper_landing_page/public/assets/functions/_is-length-ed12829b6bbace0c320b87ad01ba0e91.css
I, [2015-05-21T19:00:38.742276 #14721]  INFO -- : Writing /Users/user_a/workspace/template/kyper_landing_page/public/assets/functions/_is-light-ed12829b6bbace0c320b87ad01ba0e91.css
I, [2015-05-21T19:00:38.748894 #14721]  INFO -- : Writing /Users/user_a/workspace/template/kyper_landing_page/public/assets/functions/_is-number-ed12829b6bbace0c320b87ad01ba0e91.css
I, [2015-05-21T19:00:38.754851 #14721]  INFO -- : Writing /Users/user_a/workspace/template/kyper_landing_page/public/assets/functions/_is-size-ed12829b6bbace0c320b87ad01ba0e91.css
rake aborted!
Sass::SyntaxError: Undefined variable: "$em-base".
  (in /Users/user_a/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/bourbon-4.2.3/app/assets/stylesheets/functions/_modular-scale.scss:21)

F, [2015-05-21T18:58:10.681816 #14585] FATAL -- :
ActionController::RoutingError (No route matches [HEAD] "/assets/img/backgrounds/3_darker@2x.jpg"):
  actionpack (4.2.0) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
  actionpack (4.2.0) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
  railties (4.2.0) lib/rails/rack/logger.rb:38:in `call_app'

assets structure

https://i.imgur.com/pDgNK0N.png

schneems commented 9 years ago

If this is still an active issue can you close this one and re-open it at http://github.com/rails/sprockets. Active development has moved to that repo.

If you've got a bug with sprockets 3 please make sure you've tried the latest 3.3.3. If you can confirm this is still an active issue, the fastest way to get it fixed is to create a small example app that reproduces the failure and open an issue in the new repo http://github.com/rails/sprockets.

rafaelfranca commented 8 years ago

This issue was moved to rails/sprockets#184