Skip to content
This repository has been archived by the owner on Nov 13, 2022. It is now read-only.

sass fails to load #12

Open
dazza-codes opened this issue Sep 6, 2016 · 2 comments
Open

sass fails to load #12

dazza-codes opened this issue Sep 6, 2016 · 2 comments

Comments

@dazza-codes
Copy link

dazza-codes commented Sep 6, 2016

Does swagger_engine/app/assets/stylesheets/swagger_engine/application.scss really need the sass extension? Everything it includes seems to be a CSS file.

The stack trace on failing to load is:

LoadError (cannot load such file -- sass):
  .bundle/ruby/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `require'
  .bundle/ruby/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `block in require'
  .bundle/ruby/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:240:in `load_dependency'
  .bundle/ruby/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `require'
  .bundle/ruby/2.3.0/gems/sprockets-3.7.0/lib/sprockets/autoload/sass.rb:1:in `<top (required)>'
  .bundle/ruby/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `require'
  .bundle/ruby/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `block in require'
  .bundle/ruby/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:240:in `load_dependency'
  .bundle/ruby/2.3.0/gems/activesupport-4.2.7.1/lib/active_support/dependencies.rb:274:in `require'
  .bundle/ruby/2.3.0/gems/sprockets-3.7.0/lib/sprockets/sass_processor.rb:47:in `initialize'
  .bundle/ruby/2.3.0/gems/sprockets-3.7.0/lib/sprockets/sass_processor.rb:26:in `new'
  .bundle/ruby/2.3.0/gems/sprockets-3.7.0/lib/sprockets/sass_processor.rb:26:in `instance'
  .bundle/ruby/2.3.0/gems/sprockets-3.7.0/lib/sprockets/sass_processor.rb:30:in `call'
  .bundle/ruby/2.3.0/gems/sprockets-3.7.0/lib/sprockets/processor_utils.rb:75:in `call_processor'
  .bundle/ruby/2.3.0/gems/sprockets-3.7.0/lib/sprockets/processor_utils.rb:57:in `block in call_processors'
  .bundle/ruby/2.3.0/gems/sprockets-3.7.0/lib/sprockets/processor_utils.rb:56:in `reverse_each'
  .bundle/ruby/2.3.0/gems/sprockets-3.7.0/lib/sprockets/processor_utils.rb:56:in `call_processors'
  .bundle/ruby/2.3.0/gems/sprockets-3.7.0/lib/sprockets/loader.rb:134:in `load_from_unloaded'
  .bundle/ruby/2.3.0/gems/sprockets-3.7.0/lib/sprockets/loader.rb:60:in `block in load'
  .bundle/ruby/2.3.0/gems/sprockets-3.7.0/lib/sprockets/loader.rb:317:in `fetch_asset_from_dependency_cache'
  .bundle/ruby/2.3.0/gems/sprockets-3.7.0/lib/sprockets/loader.rb:44:in `load'
  .bundle/ruby/2.3.0/gems/sprockets-3.7.0/lib/sprockets/cached_environment.rb:20:in `block in initialize'
  .bundle/ruby/2.3.0/gems/sprockets-3.7.0/lib/sprockets/cached_environment.rb:47:in `load'
  .bundle/ruby/2.3.0/gems/sprockets-3.7.0/lib/sprockets/bundle.rb:23:in `block in call'
  .bundle/ruby/2.3.0/gems/sprockets-3.7.0/lib/sprockets/utils.rb:196:in `dfs'
  .bundle/ruby/2.3.0/gems/sprockets-3.7.0/lib/sprockets/bundle.rb:24:in `call'
  .bundle/ruby/2.3.0/gems/sprockets-3.7.0/lib/sprockets/processor_utils.rb:75:in `call_processor'
  .bundle/ruby/2.3.0/gems/sprockets-3.7.0/lib/sprockets/processor_utils.rb:57:in `block in call_processors'
  .bundle/ruby/2.3.0/gems/sprockets-3.7.0/lib/sprockets/processor_utils.rb:56:in `reverse_each'
  .bundle/ruby/2.3.0/gems/sprockets-3.7.0/lib/sprockets/processor_utils.rb:56:in `call_processors'
  .bundle/ruby/2.3.0/gems/sprockets-3.7.0/lib/sprockets/loader.rb:134:in `load_from_unloaded'
  .bundle/ruby/2.3.0/gems/sprockets-3.7.0/lib/sprockets/loader.rb:60:in `block in load'
  .bundle/ruby/2.3.0/gems/sprockets-3.7.0/lib/sprockets/loader.rb:317:in `fetch_asset_from_dependency_cache'
  .bundle/ruby/2.3.0/gems/sprockets-3.7.0/lib/sprockets/loader.rb:44:in `load'
  .bundle/ruby/2.3.0/gems/sprockets-3.7.0/lib/sprockets/cached_environment.rb:20:in `block in initialize'
  .bundle/ruby/2.3.0/gems/sprockets-3.7.0/lib/sprockets/cached_environment.rb:47:in `load'
  .bundle/ruby/2.3.0/gems/sprockets-3.7.0/lib/sprockets/base.rb:66:in `find_asset'
  .bundle/ruby/2.3.0/gems/sprockets-3.7.0/lib/sprockets/base.rb:92:in `[]'
  .bundle/ruby/2.3.0/gems/sprockets-rails-3.1.1/lib/sprockets/rails/helper.rb:338:in `find_asset'
  .bundle/ruby/2.3.0/gems/sprockets-rails-3.1.1/lib/sprockets/rails/helper.rb:330:in `find_debug_asset'
  .bundle/ruby/2.3.0/gems/sprockets-rails-3.1.1/lib/sprockets/rails/helper.rb:212:in `block in lookup_debug_asset'
  .bundle/ruby/2.3.0/gems/sprockets-rails-3.1.1/lib/sprockets/rails/helper.rb:225:in `block in resolve_asset'
  .bundle/ruby/2.3.0/gems/sprockets-rails-3.1.1/lib/sprockets/rails/helper.rb:224:in `each'
  .bundle/ruby/2.3.0/gems/sprockets-rails-3.1.1/lib/sprockets/rails/helper.rb:224:in `detect'
  .bundle/ruby/2.3.0/gems/sprockets-rails-3.1.1/lib/sprockets/rails/helper.rb:224:in `resolve_asset'
  .bundle/ruby/2.3.0/gems/sprockets-rails-3.1.1/lib/sprockets/rails/helper.rb:211:in `lookup_debug_asset'
  .bundle/ruby/2.3.0/gems/sprockets-rails-3.1.1/lib/sprockets/rails/helper.rb:153:in `block in stylesheet_link_tag'
  .bundle/ruby/2.3.0/gems/sprockets-rails-3.1.1/lib/sprockets/rails/helper.rb:152:in `map'
  .bundle/ruby/2.3.0/gems/sprockets-rails-3.1.1/lib/sprockets/rails/helper.rb:152:in `stylesheet_link_tag'
  .bundle/ruby/2.3.0/gems/swagger_engine-0.0.3/app/views/swagger_engine/swaggers/show.html.erb:9:in `__bundle_ruby_______gems_swagger_engine_______app_views_swagger_engine_swaggers_show_html_erb___3304769952346300383_47108061396880'
@dazza-codes
Copy link
Author

To get things working, I had to:

  1. Add gem 'sass-rails' to Gemfile and bundle install
  2. Add the following to config/initializers/assets.rb
Rails.application.config.assets.precompile += %w( swagger_engine/reset.css )
Rails.application.config.assets.precompile += %w( swagger_engine/print.css )

Not clear about why these additions are required. (The base rails app is for an API and it doesn't seem to include sass by default.)

@scarroll32
Copy link

I had the same issue. Does it need to be documented in the README?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants