Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot load such file -- sass #114

Closed
Marcellllll opened this issue Nov 17, 2018 · 14 comments · Fixed by rails/sprockets#759
Closed

cannot load such file -- sass #114

Marcellllll opened this issue Nov 17, 2018 · 14 comments · Fixed by rails/sprockets#759

Comments

@Marcellllll
Copy link

Hi,

I am trying to move from sass-rails to sassc-rails due to sass-rails becoming obsolete and due to big compilation delays (having rack-time-outs when reloading after changing a sass file),.

When I start my development server after replacing sass-rails with sassc-rails I get the following error:

cannot load such file -- sass (in the line of the stylesheet_link_tag in the html)

When using sassc-rails and I enter SassC in the irb console I get a NameError (uninitialized constant) (not sure whether this is useful information).

I am running out of ideas to test of what it might be...

Anybody has any idea what this might be due to ?

Thanks and kind regards,

Marcel

@rlue
Copy link

rlue commented Nov 22, 2018

I can confirm that this is happening on an existing, large Rails application I work on (Ruby 2.4.4 / Rails 5.1.5).

It is not happening on a brand new Rails application with roughly the same versions (Ruby 2.4.4 / Rails 5.1.6), nor on current versions (Ruby 2.5.0 / Rails 5.2).

Below are the contents of the Rails error page:

LoadError in InitController#index

cannot load such file -- sass

Extracted source (around line #8):

6  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
7  <title><%= Setting.get('product_name') %></title>
8  <%= stylesheet_link_tag "application", :media => 'all' %>
9  <%= stylesheet_link_tag "application-print", :media => 'print' %>
10 <% if Rails.configuration.assets.debug %>
11 <%= javascript_include_tag "application" %>

Rails.root: /home/rlue/Projects/zammad

Application Trace

app/views/layouts/application.html.erb:8:in `_app_views_layouts_application_html_erb___404047963644414565_47061518111360'

Framework (Full) Trace

activesupport (5.1.5) lib/active_support/dependencies.rb:292:in `require'
activesupport (5.1.5) lib/active_support/dependencies.rb:292:in `block in require'
activesupport (5.1.5) lib/active_support/dependencies.rb:258:in `load_dependency'
activesupport (5.1.5) lib/active_support/dependencies.rb:292:in `require'
sprockets (3.7.2) lib/sprockets/autoload/sass.rb:1:in `<top (required)>'
activesupport (5.1.5) lib/active_support/dependencies.rb:292:in `require'
activesupport (5.1.5) lib/active_support/dependencies.rb:292:in `block in require'
activesupport (5.1.5) lib/active_support/dependencies.rb:258:in `load_dependency'
activesupport (5.1.5) lib/active_support/dependencies.rb:292:in `require'
sprockets (3.7.2) lib/sprockets/sass_processor.rb:47:in `initialize'
sprockets (3.7.2) lib/sprockets/sass_processor.rb:26:in `new'
sprockets (3.7.2) lib/sprockets/sass_processor.rb:26:in `instance'
sprockets (3.7.2) lib/sprockets/sass_processor.rb:34:in `cache_key'
sprockets (3.7.2) lib/sprockets/processor_utils.rb:93:in `processor_cache_key'
sprockets (3.7.2) lib/sprockets/cached_environment.rb:22:in `block in initialize'
sprockets (3.7.2) lib/sprockets/cached_environment.rb:53:in `processor_cache_key'
sprockets (3.7.2) lib/sprockets/processor_utils.rb:102:in `block in processors_cache_keys'
sprockets (3.7.2) lib/sprockets/processor_utils.rb:102:in `map'
sprockets (3.7.2) lib/sprockets/processor_utils.rb:102:in `processors_cache_keys'
sprockets (3.7.2) lib/sprockets/processing.rb:159:in `resolve_processors_cache_key_uri'
sprockets (3.7.2) lib/sprockets.rb:162:in `block in <module:Sprockets>'
sprockets (3.7.2) lib/sprockets/dependencies.rb:67:in `resolve_dependency'
sprockets (3.7.2) lib/sprockets/cached_environment.rb:23:in `block in initialize'
sprockets (3.7.2) lib/sprockets/cached_environment.rb:59:in `resolve_dependency'
sprockets (3.7.2) lib/sprockets/loader.rb:268:in `block in resolve_dependencies'
sprockets (3.7.2) lib/sprockets/loader.rb:268:in `map'
sprockets (3.7.2) lib/sprockets/loader.rb:268:in `resolve_dependencies'
sprockets (3.7.2) lib/sprockets/loader.rb:55:in `block in load'
sprockets (3.7.2) lib/sprockets/loader.rb:311:in `block in fetch_asset_from_dependency_cache'
sprockets (3.7.2) lib/sprockets/loader.rb:307:in `each'
sprockets (3.7.2) lib/sprockets/loader.rb:307:in `each_with_index'
sprockets (3.7.2) lib/sprockets/loader.rb:307:in `fetch_asset_from_dependency_cache'
sprockets (3.7.2) lib/sprockets/loader.rb:44:in `load'
sprockets (3.7.2) lib/sprockets/cached_environment.rb:20:in `block in initialize'
sprockets (3.7.2) lib/sprockets/cached_environment.rb:47:in `load'
sprockets (3.7.2) lib/sprockets/base.rb:66:in `find_asset'
sprockets (3.7.2) lib/sprockets/base.rb:92:in `[]'
sprockets-rails (3.2.1) lib/sprockets/rails/helper.rb:355:in `find_asset'
sprockets-rails (3.2.1) lib/sprockets/rails/helper.rb:329:in `asset_path'
sprockets-rails (3.2.1) lib/sprockets/rails/helper.rb:102:in `block in resolve_asset_path'
sprockets-rails (3.2.1) lib/sprockets/rails/helper.rb:242:in `block in resolve_asset'
sprockets-rails (3.2.1) lib/sprockets/rails/helper.rb:241:in `each'
sprockets-rails (3.2.1) lib/sprockets/rails/helper.rb:241:in `detect'
sprockets-rails (3.2.1) lib/sprockets/rails/helper.rb:241:in `resolve_asset'
sprockets-rails (3.2.1) lib/sprockets/rails/helper.rb:101:in `resolve_asset_path'
sprockets-rails (3.2.1) lib/sprockets/rails/helper.rb:79:in `compute_asset_path'
actionview (5.1.5) lib/action_view/helpers/asset_url_helper.rb:198:in `asset_path'
actionview (5.1.5) lib/action_view/helpers/asset_url_helper.rb:343:in `stylesheet_path'
actionview (5.1.5) lib/action_view/helpers/asset_tag_helper.rb:118:in `block in stylesheet_link_tag'
actionview (5.1.5) lib/action_view/helpers/asset_tag_helper.rb:114:in `map'
actionview (5.1.5) lib/action_view/helpers/asset_tag_helper.rb:114:in `stylesheet_link_tag'
sprockets-rails (3.2.1) lib/sprockets/rails/helper.rb:185:in `block in stylesheet_link_tag'
sprockets-rails (3.2.1) lib/sprockets/rails/helper.rb:183:in `map'
sprockets-rails (3.2.1) lib/sprockets/rails/helper.rb:183:in `stylesheet_link_tag'
actionview (5.1.5) lib/action_view/template.rb:157:in `block in render'
activesupport (5.1.5) lib/active_support/notifications.rb:168:in `instrument'
actionview (5.1.5) lib/action_view/template.rb:352:in `instrument_render_template'
actionview (5.1.5) lib/action_view/template.rb:155:in `render'
actionview (5.1.5) lib/action_view/renderer/template_renderer.rb:64:in `render_with_layout'
actionview (5.1.5) lib/action_view/renderer/template_renderer.rb:50:in `render_template'
actionview (5.1.5) lib/action_view/renderer/template_renderer.rb:14:in `render'
actionview (5.1.5) lib/action_view/renderer/renderer.rb:42:in `render_template'
actionview (5.1.5) lib/action_view/renderer/renderer.rb:23:in `render'
actionview (5.1.5) lib/action_view/rendering.rb:103:in `_render_template'
actionpack (5.1.5) lib/action_controller/metal/streaming.rb:217:in `_render_template'
actionview (5.1.5) lib/action_view/rendering.rb:83:in `render_to_body'
actionpack (5.1.5) lib/action_controller/metal/rendering.rb:52:in `render_to_body'
actionpack (5.1.5) lib/action_controller/metal/renderers.rb:141:in `render_to_body'
actionpack (5.1.5) lib/abstract_controller/rendering.rb:24:in `render'
actionpack (5.1.5) lib/action_controller/metal/rendering.rb:36:in `render'
actionpack (5.1.5) lib/action_controller/metal/instrumentation.rb:44:in `block (2 levels) in render'
activesupport (5.1.5) lib/active_support/core_ext/benchmark.rb:12:in `block in ms'
/home/rlue/.rbenv/versions/2.4.4/lib/ruby/2.4.0/benchmark.rb:308:in `realtime'
activesupport (5.1.5) lib/active_support/core_ext/benchmark.rb:12:in `ms'
actionpack (5.1.5) lib/action_controller/metal/instrumentation.rb:44:in `block in render'
actionpack (5.1.5) lib/action_controller/metal/instrumentation.rb:87:in `cleanup_view_runtime'
activerecord (5.1.5) lib/active_record/railties/controller_runtime.rb:29:in `cleanup_view_runtime'
actionpack (5.1.5) lib/action_controller/metal/instrumentation.rb:43:in `render'
actionpack (5.1.5) lib/action_controller/metal/implicit_render.rb:33:in `default_render'
actionpack (5.1.5) lib/action_controller/metal/basic_implicit_render.rb:4:in `block in send_action'
actionpack (5.1.5) lib/action_controller/metal/basic_implicit_render.rb:4:in `tap'
actionpack (5.1.5) lib/action_controller/metal/basic_implicit_render.rb:4:in `send_action'
actionpack (5.1.5) lib/abstract_controller/base.rb:186:in `process_action'
actionpack (5.1.5) lib/action_controller/metal/rendering.rb:30:in `process_action'
actionpack (5.1.5) lib/abstract_controller/callbacks.rb:20:in `block in process_action'
activesupport (5.1.5) lib/active_support/callbacks.rb:131:in `run_callbacks'
actionpack (5.1.5) lib/abstract_controller/callbacks.rb:19:in `process_action'
actionpack (5.1.5) lib/action_controller/metal/rescue.rb:20:in `process_action'
actionpack (5.1.5) lib/action_controller/metal/instrumentation.rb:32:in `block in process_action'
activesupport (5.1.5) lib/active_support/notifications.rb:166:in `block in instrument'
activesupport (5.1.5) lib/active_support/notifications/instrumenter.rb:21:in `instrument'
activesupport (5.1.5) lib/active_support/notifications.rb:166:in `instrument'
actionpack (5.1.5) lib/action_controller/metal/instrumentation.rb:30:in `process_action'
actionpack (5.1.5) lib/action_controller/metal/params_wrapper.rb:252:in `process_action'
activerecord (5.1.5) lib/active_record/railties/controller_runtime.rb:22:in `process_action'
actionpack (5.1.5) lib/abstract_controller/base.rb:124:in `process'
actionview (5.1.5) lib/action_view/rendering.rb:30:in `process'
actionpack (5.1.5) lib/action_controller/metal.rb:189:in `dispatch'
actionpack (5.1.5) lib/action_controller/metal.rb:253:in `dispatch'
actionpack (5.1.5) lib/action_dispatch/routing/route_set.rb:49:in `dispatch'
actionpack (5.1.5) lib/action_dispatch/routing/route_set.rb:31:in `serve'
actionpack (5.1.5) lib/action_dispatch/journey/router.rb:50:in `block in serve'
actionpack (5.1.5) lib/action_dispatch/journey/router.rb:33:in `each'
actionpack (5.1.5) lib/action_dispatch/journey/router.rb:33:in `serve'
actionpack (5.1.5) lib/action_dispatch/routing/route_set.rb:844:in `call'
omniauth (1.7.1) lib/omniauth/strategy.rb:190:in `call!'
omniauth (1.7.1) lib/omniauth/strategy.rb:168:in `call'
omniauth (1.7.1) lib/omniauth/strategy.rb:190:in `call!'
omniauth (1.7.1) lib/omniauth/strategy.rb:168:in `call'
omniauth (1.7.1) lib/omniauth/strategy.rb:190:in `call!'
omniauth (1.7.1) lib/omniauth/strategy.rb:168:in `call'
omniauth (1.7.1) lib/omniauth/strategy.rb:190:in `call!'
omniauth (1.7.1) lib/omniauth/strategy.rb:168:in `call'
omniauth (1.7.1) lib/omniauth/strategy.rb:190:in `call!'
omniauth (1.7.1) lib/omniauth/strategy.rb:168:in `call'
omniauth (1.7.1) lib/omniauth/strategy.rb:190:in `call!'
omniauth (1.7.1) lib/omniauth/strategy.rb:168:in `call'
omniauth (1.7.1) lib/omniauth/strategy.rb:190:in `call!'
omniauth (1.7.1) lib/omniauth/strategy.rb:168:in `call'
omniauth (1.7.1) lib/omniauth/strategy.rb:190:in `call!'
omniauth (1.7.1) lib/omniauth/strategy.rb:168:in `call'
omniauth (1.7.1) lib/omniauth/strategy.rb:190:in `call!'
omniauth (1.7.1) lib/omniauth/strategy.rb:168:in `call'
omniauth (1.7.1) lib/omniauth/builder.rb:63:in `call'
bullet (5.9.0) lib/bullet/rack.rb:12:in `call'
rack (2.0.6) lib/rack/etag.rb:25:in `call'
rack (2.0.6) lib/rack/conditional_get.rb:25:in `call'
rack (2.0.6) lib/rack/head.rb:12:in `call'
rack (2.0.6) lib/rack/session/abstract/id.rb:232:in `context'
rack (2.0.6) lib/rack/session/abstract/id.rb:226:in `call'
actionpack (5.1.5) lib/action_dispatch/middleware/cookies.rb:613:in `call'
activerecord (5.1.5) lib/active_record/migration.rb:556:in `call'
actionpack (5.1.5) lib/action_dispatch/middleware/callbacks.rb:26:in `block in call'
activesupport (5.1.5) lib/active_support/callbacks.rb:97:in `run_callbacks'
actionpack (5.1.5) lib/action_dispatch/middleware/callbacks.rb:24:in `call'
actionpack (5.1.5) lib/action_dispatch/middleware/executor.rb:12:in `call'
actionpack (5.1.5) lib/action_dispatch/middleware/debug_exceptions.rb:59:in `call'
actionpack (5.1.5) lib/action_dispatch/middleware/show_exceptions.rb:31:in `call'
railties (5.1.5) lib/rails/rack/logger.rb:36:in `call_app'
railties (5.1.5) lib/rails/rack/logger.rb:24:in `block in call'
activesupport (5.1.5) lib/active_support/tagged_logging.rb:69:in `block in tagged'
activesupport (5.1.5) lib/active_support/tagged_logging.rb:26:in `tagged'
activesupport (5.1.5) lib/active_support/tagged_logging.rb:69:in `tagged'
railties (5.1.5) lib/rails/rack/logger.rb:24:in `call'
actionpack (5.1.5) lib/action_dispatch/middleware/remote_ip.rb:79:in `call'
actionpack (5.1.5) lib/action_dispatch/middleware/request_id.rb:25:in `call'
rack (2.0.6) lib/rack/method_override.rb:22:in `call'
rack (2.0.6) lib/rack/runtime.rb:22:in `call'
activesupport (5.1.5) lib/active_support/cache/strategy/local_cache_middleware.rb:27:in `call'
actionpack (5.1.5) lib/action_dispatch/middleware/executor.rb:12:in `call'
actionpack (5.1.5) lib/action_dispatch/middleware/static.rb:125:in `call'
rack (2.0.6) lib/rack/sendfile.rb:111:in `call'
railties (5.1.5) lib/rails/engine.rb:522:in `call'
puma (3.11.0) lib/puma/configuration.rb:225:in `call'
puma (3.11.0) lib/puma/server.rb:624:in `handle_request'
puma (3.11.0) lib/puma/server.rb:438:in `process_client'
puma (3.11.0) lib/puma/server.rb:302:in `block in run'
puma (3.11.0) lib/puma/thread_pool.rb:120:in `block in spawn_thread'
logging (2.2.2) lib/logging/diagnostic_context.rb:474:in `block in create_with_logging_context'
This error occurred while loading the following files:
   sprockets/autoload/sass
   sass

Request

Parameters: None

Session Dump

ping: "2018-11-22T10:10:35Z"
user_agent: "Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0"

Env Dump

GATEWAY_INTERFACE: "CGI/1.2"
HTTP_ACCEPT: "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
HTTP_ACCEPT_ENCODING: "gzip, deflate"
HTTP_ACCEPT_LANGUAGE: "en-US,zh-TW;q=0.7,en;q=0.3"
HTTP_VERSION: "HTTP/1.1"
ORIGINAL_SCRIPT_NAME: ""
REMOTE_ADDR: "::1"
SERVER_NAME: "localhost"
SERVER_PROTOCOL: "HTTP/1.1"

Response

Headers: None

@Marcellllll
Copy link
Author

Our application is reasonably big, and is using Ruby 2.5.3p105, and Rails 5.2.1 (progressively migrated from Rails 3.2).

The error is happening in the same place: the stylesheet_link_tag in the html.

Could it be some kind of setting from an earlier Rails version that gets migrated, and should be removed in order for sassc to work ?

@thorsteneckel
Copy link

thorsteneckel commented Nov 22, 2018

JFI: You can put the gem 'sassc-rails' line before the gem 'rails' line in your Gemfile as a workaround. This works for the rails app @rlue mentioned in his comment. We need to dig deeper what's causing this exactly.

@Marcellllll
Copy link
Author

Thank you !!

This worked, and the assets are compiled a lot quicker now 👍

@thorsteneckel
Copy link

Nice! You're welcome. I'd love to see that it works in a way that the gem 'rails' line is first. Would you mind re-opening the issue until we resolve it or should I create a new one?

@rlue
Copy link

rlue commented Nov 23, 2018

I just tried this myself, and it turned out what mattered wasn't putting it before gem 'rails', but removing it from the group :assets block.

FWIW, this SO answer explains why the group :assets block was removed in Rails 4.

@Marcellllll Marcellllll reopened this Nov 23, 2018
@Marcellllll
Copy link
Author

Hi Ryan,

That's it !

I also had an assets group in the Gemfile due to coming from an older version of Rails. I moved the sassc-rails gem back to its previous location and removed the assets group, and everything is still working :-).

Thorsten, I opened and closed the issue again. Please tell me if you think there is a need to re-open it.

@amitsaxena
Copy link

amitsaxena commented Oct 13, 2019

Strangely this still is a problem for me in a new rails 6.0.0 app and moving gem 'sassc-rails' above gem 'rails', '~> 6.0.0' doesn't seem to help. I was attempting to migrate a fairly new app from sass-rails (5.1.0) to sassc-rails (2.1.2) and started seeing this exception.

I also don't seem to have an assets block in my Gemfile. This is what the Gemfile looks like:

source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

ruby '2.6.4'

# Use SCSS for stylesheets
gem 'sassc-rails'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 6.0.0'
# Use postgresql as the database for Active Record
gem 'pg', '>= 0.18', '< 2.0'
# Use Puma as the app server
gem 'puma', '~> 4.2'
# Transpile app-like JavaScript. Read more: https://github.com/rails/webpacker
gem 'webpacker', '~> 4.0'
# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
gem 'turbolinks', '~> 5'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.7'
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 4.0'
# Use Active Model has_secure_password
# gem 'bcrypt', '~> 3.1.7'

# Use Active Storage variant
# gem 'image_processing', '~> 1.2'

# Reduces boot times through caching; required in config/boot.rb
gem 'bootsnap', '>= 1.4.2', require: false

group :development, :test do
  # Call 'byebug' anywhere in the code to stop execution and get a debugger console
  gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
end

group :development do
  # Access an interactive console on exception pages or by calling 'console' anywhere in the code.
  gem 'listen', '>= 3.0.5', '< 3.3'
  gem 'web-console', '>= 3.3.0'
end

group :test do
  # Adds support for Capybara system testing and selenium driver
  gem 'capybara', '>= 2.15'
  gem 'minitest-ci'
  gem 'selenium-webdriver'
  # Easy installation and use of web drivers to run system tests with browsers
  gem 'webdrivers'
end

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

gem 'devise'
gem 'dotenv-rails', groups: [:development, :test]

This is the exception stacktrace:

LoadError (cannot load such file -- sass):
  
bootsnap (1.4.5) lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require'
bootsnap (1.4.5) lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
bootsnap (1.4.5) lib/bootsnap/load_path_cache/loaded_features_index.rb:89:in `register'
bootsnap (1.4.5) lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
bootsnap (1.4.5) lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:40:in `rescue in require'
bootsnap (1.4.5) lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:26:in `require'
zeitwerk (2.2.0) lib/zeitwerk/kernel.rb:23:in `require'
sprockets (3.7.2) lib/sprockets/autoload/sass.rb:1:in `<main>'
bootsnap (1.4.5) lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require'
bootsnap (1.4.5) lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
bootsnap (1.4.5) lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
bootsnap (1.4.5) lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
bootsnap (1.4.5) lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
zeitwerk (2.2.0) lib/zeitwerk/kernel.rb:23:in `require'
sprockets (3.7.2) lib/sprockets/sass_processor.rb:47:in `initialize'
sprockets (3.7.2) lib/sprockets/sass_processor.rb:26:in `new'
sprockets (3.7.2) lib/sprockets/sass_processor.rb:26:in `instance'
sprockets (3.7.2) lib/sprockets/sass_processor.rb:34:in `cache_key'
sprockets (3.7.2) lib/sprockets/processor_utils.rb:93:in `processor_cache_key'
sprockets (3.7.2) lib/sprockets/cached_environment.rb:22:in `block in initialize'
sprockets (3.7.2) lib/sprockets/cached_environment.rb:53:in `processor_cache_key'
sprockets (3.7.2) lib/sprockets/processor_utils.rb:102:in `block in processors_cache_keys'
sprockets (3.7.2) lib/sprockets/processor_utils.rb:102:in `map'
sprockets (3.7.2) lib/sprockets/processor_utils.rb:102:in `processors_cache_keys'
sprockets (3.7.2) lib/sprockets/processing.rb:159:in `resolve_processors_cache_key_uri'
sprockets (3.7.2) lib/sprockets.rb:162:in `block in <module:Sprockets>'
sprockets (3.7.2) lib/sprockets/dependencies.rb:67:in `resolve_dependency'
sprockets (3.7.2) lib/sprockets/cached_environment.rb:23:in `block in initialize'
sprockets (3.7.2) lib/sprockets/cached_environment.rb:59:in `resolve_dependency'
sprockets (3.7.2) lib/sprockets/loader.rb:268:in `block in resolve_dependencies'
sprockets (3.7.2) lib/sprockets/loader.rb:268:in `map'
sprockets (3.7.2) lib/sprockets/loader.rb:268:in `resolve_dependencies'
sprockets (3.7.2) lib/sprockets/loader.rb:55:in `block in load'
sprockets (3.7.2) lib/sprockets/loader.rb:311:in `block in fetch_asset_from_dependency_cache'
sprockets (3.7.2) lib/sprockets/loader.rb:307:in `each'
sprockets (3.7.2) lib/sprockets/loader.rb:307:in `each_with_index'
sprockets (3.7.2) lib/sprockets/loader.rb:307:in `fetch_asset_from_dependency_cache'
sprockets (3.7.2) lib/sprockets/loader.rb:44:in `load'
sprockets (3.7.2) lib/sprockets/cached_environment.rb:20:in `block in initialize'
sprockets (3.7.2) lib/sprockets/cached_environment.rb:47:in `load'
sprockets (3.7.2) lib/sprockets/base.rb:66:in `find_asset'
sprockets (3.7.2) lib/sprockets/environment.rb:30:in `find_asset'
sprockets (3.7.2) lib/sprockets/server.rb:49:in `call'
actionpack (6.0.0) lib/action_dispatch/routing/mapper.rb:19:in `block in <class:Constraints>'
actionpack (6.0.0) lib/action_dispatch/routing/mapper.rb:48:in `serve'
actionpack (6.0.0) lib/action_dispatch/journey/router.rb:49:in `block in serve'
actionpack (6.0.0) lib/action_dispatch/journey/router.rb:32:in `each'
actionpack (6.0.0) lib/action_dispatch/journey/router.rb:32:in `serve'
actionpack (6.0.0) lib/action_dispatch/routing/route_set.rb:837:in `call'
warden (1.2.8) lib/warden/manager.rb:36:in `block in call'
warden (1.2.8) lib/warden/manager.rb:34:in `catch'
warden (1.2.8) lib/warden/manager.rb:34:in `call'
rack (2.0.7) lib/rack/tempfile_reaper.rb:15:in `call'
rack (2.0.7) lib/rack/etag.rb:25:in `call'
rack (2.0.7) lib/rack/conditional_get.rb:25:in `call'
rack (2.0.7) lib/rack/head.rb:12:in `call'
actionpack (6.0.0) lib/action_dispatch/http/content_security_policy.rb:18:in `call'
rack (2.0.7) lib/rack/session/abstract/id.rb:232:in `context'
rack (2.0.7) lib/rack/session/abstract/id.rb:226:in `call'
actionpack (6.0.0) lib/action_dispatch/middleware/cookies.rb:648:in `call'
activerecord (6.0.0) lib/active_record/migration.rb:567:in `call'
actionpack (6.0.0) lib/action_dispatch/middleware/callbacks.rb:27:in `block in call'
activesupport (6.0.0) lib/active_support/callbacks.rb:101:in `run_callbacks'
actionpack (6.0.0) lib/action_dispatch/middleware/callbacks.rb:26:in `call'
actionpack (6.0.0) lib/action_dispatch/middleware/executor.rb:14:in `call'
actionpack (6.0.0) lib/action_dispatch/middleware/actionable_exceptions.rb:17:in `call'
actionpack (6.0.0) lib/action_dispatch/middleware/debug_exceptions.rb:32:in `call'
web-console (4.0.1) lib/web_console/middleware.rb:132:in `call_app'
web-console (4.0.1) lib/web_console/middleware.rb:28:in `block in call'
web-console (4.0.1) lib/web_console/middleware.rb:17:in `catch'
web-console (4.0.1) lib/web_console/middleware.rb:17:in `call'
actionpack (6.0.0) lib/action_dispatch/middleware/show_exceptions.rb:33:in `call'
railties (6.0.0) lib/rails/rack/logger.rb:38:in `call_app'
railties (6.0.0) lib/rails/rack/logger.rb:26:in `block in call'
activesupport (6.0.0) lib/active_support/tagged_logging.rb:80:in `block in tagged'
activesupport (6.0.0) lib/active_support/tagged_logging.rb:28:in `tagged'
activesupport (6.0.0) lib/active_support/tagged_logging.rb:80:in `tagged'
railties (6.0.0) lib/rails/rack/logger.rb:26:in `call'
sprockets-rails (3.2.1) lib/sprockets/rails/quiet_assets.rb:11:in `block in call'
activesupport (6.0.0) lib/active_support/logger_silence.rb:36:in `silence'
activesupport (6.0.0) lib/active_support/logger.rb:64:in `block (3 levels) in broadcast'
activesupport (6.0.0) lib/active_support/logger_silence.rb:36:in `silence'
activesupport (6.0.0) lib/active_support/logger.rb:62:in `block (2 levels) in broadcast'
sprockets-rails (3.2.1) lib/sprockets/rails/quiet_assets.rb:11:in `call'
actionpack (6.0.0) lib/action_dispatch/middleware/remote_ip.rb:81:in `call'
actionpack (6.0.0) lib/action_dispatch/middleware/request_id.rb:27:in `call'
rack (2.0.7) lib/rack/method_override.rb:22:in `call'
rack (2.0.7) lib/rack/runtime.rb:22:in `call'
activesupport (6.0.0) lib/active_support/cache/strategy/local_cache_middleware.rb:29:in `call'
actionpack (6.0.0) lib/action_dispatch/middleware/executor.rb:14:in `call'
actionpack (6.0.0) lib/action_dispatch/middleware/static.rb:126:in `call'
rack (2.0.7) lib/rack/sendfile.rb:111:in `call'
actionpack (6.0.0) lib/action_dispatch/middleware/host_authorization.rb:83:in `call'
webpacker (4.0.7) lib/webpacker/dev_server_proxy.rb:29:in `perform_request'
rack-proxy (0.6.5) lib/rack/proxy.rb:57:in `call'
railties (6.0.0) lib/rails/engine.rb:526:in `call'
puma (4.2.1) lib/puma/configuration.rb:228:in `call'
puma (4.2.1) lib/puma/server.rb:667:in `handle_request'
puma (4.2.1) lib/puma/server.rb:470:in `process_client'
puma (4.2.1) lib/puma/server.rb:328:in `block in run'
puma (4.2.1) lib/puma/thread_pool.rb:134:in `block in spawn_thread'

@Harrisonkamau
Copy link

@amitsaxena Have you tried running bundle update --conservative?. It helps to ensure you don't have sass-rails in your Gemfile

Then run: bundle exec rake -P to make sure everything is okay

seanpdoyle added a commit to seanpdoyle/with_form that referenced this issue Apr 12, 2020
Without adding the [`sassc-rails` gem][sassc-rails] as a dependency,
attempts include the `trix.js`-provided stylesheets into the Asset
Pipeline [result in an error][sassc-rails-error].

Additionally, this commit extends the `.github/workflows/tests.yml` to
[include NodeJS support][setup-node], and to install the Dummy
application's Yarn dependencies during the setup phase (through the
[`yarn:install` Rails task][yarn:install], and to [cache the installed
Yarn packages][cache].

Finally, declare `test/dummy/config/initializers/assets.rb` to [configure
the Asset Pipeline's search path][asset-initializer] to include the
_project root's_ `node_modules/` directory.

[sassc-rails]: https://github.com/sass/sassc-rails
[sassc-rails-error]: sass/sassc-rails#114
[setup-node]: https://github.com/actions/setup-node/tree/v1#usage
[yarn:install]: https://github.com/rails/webpacker/blob/v5.0.1/lib/tasks/webpacker/yarn_install.rake
[cache]: https://github.com/actions/cache/blob/v1/examples.md#node---yarn
[asset-initializer]: https://guides.rubyonrails.org/asset_pipeline.html#search-paths
seanpdoyle added a commit to seanpdoyle/with_form that referenced this issue Apr 12, 2020
Without adding the [`sassc-rails` gem][sassc-rails] as a dependency,
attempts include the `trix.js`-provided stylesheets into the Asset
Pipeline [result in an error][sassc-rails-error].

Additionally, this commit extends the `.github/workflows/tests.yml` to
[include NodeJS support][setup-node], and to install the Dummy
application's Yarn dependencies during the setup phase (through the
[`yarn:install` Rails task][yarn:install], and to [cache the installed
Yarn packages][cache].

The `action_text` and `active_storage` provided migrations were
generated with `[5.2]` and `[6.0]` version modifiers. Since this project
will be tested against applications as old as `5.2`, this commit changes
the `ActionText` migration's version modifier to `5.2`. Other Rails
version checks will intervene when `ActionText` is unavailable in the
current test environment.

Finally, declare `test/dummy/config/initializers/assets.rb` to [configure
the Asset Pipeline's search path][asset-initializer] to include the
_project root's_ `node_modules/` directory.

[sassc-rails]: https://github.com/sass/sassc-rails
[sassc-rails-error]: sass/sassc-rails#114
[setup-node]: https://github.com/actions/setup-node/tree/v1#usage
[yarn:install]: https://github.com/rails/webpacker/blob/v5.0.1/lib/tasks/webpacker/yarn_install.rake
[cache]: https://github.com/actions/cache/blob/v1/examples.md#node---yarn
[asset-initializer]: https://guides.rubyonrails.org/asset_pipeline.html#search-paths
seanpdoyle added a commit to seanpdoyle/with_form that referenced this issue Apr 12, 2020
Without adding the [`sassc-rails` gem][sassc-rails] as a dependency,
attempts include the `trix.js`-provided stylesheets into the Asset
Pipeline [result in an error][sassc-rails-error].

Additionally, this commit extends the `.github/workflows/tests.yml` to
[include NodeJS support][setup-node], and to install the Dummy
application's Yarn dependencies during the setup phase (through the
[`yarn:install` Rails task][yarn:install], and to [cache the installed
Yarn packages][cache].

The `action_text` and `active_storage` provided migrations were
generated with `[5.2]` and `[6.0]` version modifiers. Since this project
will be tested against applications as old as `5.2`, this commit changes
the `ActionText` migration's version modifier to `5.2`. Other Rails
version checks will intervene when `ActionText` is unavailable in the
current test environment.

Finally, declare `test/dummy/config/initializers/assets.rb` to [configure
the Asset Pipeline's search path][asset-initializer] to include the
_project root's_ `node_modules/` directory.

[sassc-rails]: https://github.com/sass/sassc-rails
[sassc-rails-error]: sass/sassc-rails#114
[setup-node]: https://github.com/actions/setup-node/tree/v1#usage
[yarn:install]: https://github.com/rails/webpacker/blob/v5.0.1/lib/tasks/webpacker/yarn_install.rake
[cache]: https://github.com/actions/cache/blob/v1/examples.md#node---yarn
[asset-initializer]: https://guides.rubyonrails.org/asset_pipeline.html#search-paths
seanpdoyle added a commit to seanpdoyle/with_form that referenced this issue Apr 12, 2020
Without adding the [`sassc-rails` gem][sassc-rails] as a dependency,
attempts include the `trix.js`-provided stylesheets into the Asset
Pipeline [result in an error][sassc-rails-error].

Additionally, this commit extends the `.github/workflows/tests.yml` to
[include NodeJS support][setup-node], and to install the Dummy
application's Yarn dependencies during the setup phase (through the
[`yarn:install` Rails task][yarn:install], and to [cache the installed
Yarn packages][cache].

The `action_text` and `active_storage` provided migrations were
generated with `[5.2]` and `[6.0]` version modifiers. Since this project
will be tested against applications as old as `5.2`, this commit changes
the `ActionText` migration's version modifier to `5.2`. Other Rails
version checks will intervene when `ActionText` is unavailable in the
current test environment.

Finally, declare `test/dummy/config/initializers/assets.rb` to [configure
the Asset Pipeline's search path][asset-initializer] to include the
_project root's_ `node_modules/` directory.

[sassc-rails]: https://github.com/sass/sassc-rails
[sassc-rails-error]: sass/sassc-rails#114
[setup-node]: https://github.com/actions/setup-node/tree/v1#usage
[yarn:install]: https://github.com/rails/webpacker/blob/v5.0.1/lib/tasks/webpacker/yarn_install.rake
[cache]: https://github.com/actions/cache/blob/v1/examples.md#node---yarn
[asset-initializer]: https://guides.rubyonrails.org/asset_pipeline.html#search-paths
seanpdoyle added a commit to seanpdoyle/with_form that referenced this issue Apr 12, 2020
Without adding the [`sassc-rails` gem][sassc-rails] as a dependency,
attempts include the `trix.js`-provided stylesheets into the Asset
Pipeline [result in an error][sassc-rails-error].

Additionally, this commit extends the `.github/workflows/tests.yml` to
[include NodeJS support][setup-node], and to install the Dummy
application's Yarn dependencies during the setup phase (through the
[`yarn:install` Rails task][yarn:install], compile the test assets with
the [`app:webpacker:compile` task][webpacker:compile], and to [cache the
installed Yarn packages][cache].

One oddity worth mentioning is that the `rails app:webpacker:compile`
won't execute unless the `bin/webpack` file exists. The file doesn't
need any contents, but there must be a presence check guard clause. The
corresponding `test/dummy/bin/webpack` _does_ exist, and properly
configures and executes the [Webpack CLI commands][webpack-cli].

The `action_text` and `active_storage` provided migrations were
generated with `[5.2]` and `[6.0]` version modifiers. Since this project
will be tested against applications as old as `5.2`, this commit changes
the `ActionText` migration's version modifier to `5.2`. Other Rails
version checks will intervene when `ActionText` is unavailable in the
current test environment.

Finally, declare `test/dummy/config/initializers/assets.rb` to [configure
the Asset Pipeline's search path][asset-initializer] to include the
_project root's_ `node_modules/` directory.

[sassc-rails]: https://github.com/sass/sassc-rails
[sassc-rails-error]: sass/sassc-rails#114
[setup-node]: https://github.com/actions/setup-node/tree/v1#usage
[yarn:install]: https://github.com/rails/webpacker/blob/v5.0.1/lib/tasks/webpacker/yarn_install.rake
[webpacker:compile]: https://github.com/rails/webpacker/tree/v5.0.1#deployment
[webpack-cli]: https://webpack.js.org/api/cli/
[cache]: https://github.com/actions/cache/blob/v1/examples.md#node---yarn
[asset-initializer]: https://guides.rubyonrails.org/asset_pipeline.html#search-paths
@nabinghising406
Copy link

Thank you it solved my problem!

@donv
Copy link

donv commented Jan 5, 2021

I had the same symptom as described in this issue, but a slightly different cause. Including it here to help others 😄 .

I use a gem, chosen-rails, that has sassc-rails as a runtime dependency. I thought this would be enough to enable sprockets to use sassc, but it seems it is not.

Simply adding gem 'sassc-rails' to the Gemfile fixed it.

@dangerrg
Copy link

In Rails 7 this still is an issue for me. However, the gem 'sassc-rails' (already included in the Gemfile) is commented out by default:

All I did was to uncomment it, run bundle, restart the server, and it worked!

# Use Sass to process CSS
gem "sassc-rails"

@jasonfb
Copy link

jasonfb commented Jun 15, 2023

I'm working on Rails 6.1 app where I actually want to remove the old sass-rails gem and, ideally, NOT replace it with the new gem because our app does not use sass whatsoever.

Unfortunately, I am also running into this LoadError: cannot load such file -- sass on my mailers only for outgoing mail (although they are not using SASS at all)

the stacktrace of my crash is here: https://gist.github.com/jasonfb-swift/e2e72599efeedfa0eb6063c1e4a42d6a

in my application.rb I have the css preprocessor set to nil

 config.assets.css_compressor = nil

I have searched my app for any further references to sass but can't find any.

noczero added a commit to noczero/Learn-Rails-Project that referenced this issue Jun 24, 2023
Uncomment line 46 to use Sass to process CSS. Avoid bugs in rails 7.

Command:
# to reinstall it
$ bundle install

Refence:
sass/sassc-rails#114
@ankushverma784
Copy link

LoadError in HomeController#index

cannot load such file -- sassc

Extracted source (around line #9):
7 <%= csp_meta_tag %>
8
9 <%= stylesheet_link_tag "application", "data-turbo-track": "reload" %>
10 <%= javascript_importmap_tags %>

getting erroe
and change the gem file with sassc version but no change in app

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

Successfully merging a pull request may close this issue.

10 participants