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

Fails without sassc-rails #449

Open
joshmn opened this issue May 31, 2023 · 0 comments
Open

Fails without sassc-rails #449

joshmn opened this issue May 31, 2023 · 0 comments

Comments

@joshmn
Copy link

joshmn commented May 31, 2023

I use dartsass-rails in one of my projects. Without sassc-rails, I can't run the generator:

<internal:/Users/donkey/.rbenv/versions/3.2.1/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require': cannot load such file -- sassc (LoadError)
	from <internal:/Users/donkey/.rbenv/versions/3.2.1/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
	from /Users/donkey/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:17:in `require'
	from /Users/donkey/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/better_errors-2.10.0/lib/better_errors/error_page_style.rb:1:in `<main>'
	from <internal:/Users/donkey/.rbenv/versions/3.2.1/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
	from <internal:/Users/donkey/.rbenv/versions/3.2.1/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
	from /Users/donkey/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
	from /Users/donkey/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/better_errors-2.10.0/lib/better_errors/error_page.rb:5:in `<main>'
	from <internal:/Users/donkey/.rbenv/versions/3.2.1/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
	from <internal:/Users/donkey/.rbenv/versions/3.2.1/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
	from /Users/donkey/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
	from /Users/donkey/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/better_errors-2.10.0/lib/better_errors.rb:8:in `<main>'
	from <internal:/Users/donkey/.rbenv/versions/3.2.1/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
	from <internal:/Users/donkey/.rbenv/versions/3.2.1/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
	from /Users/donkey/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
	from /Users/donkey/.rbenv/versions/3.2.1/lib/ruby/3.2.0/bundler/runtime.rb:60:in `block (2 levels) in require'
	from /Users/donkey/.rbenv/versions/3.2.1/lib/ruby/3.2.0/bundler/runtime.rb:55:in `each'
	from /Users/donkey/.rbenv/versions/3.2.1/lib/ruby/3.2.0/bundler/runtime.rb:55:in `block in require'
	from /Users/donkey/.rbenv/versions/3.2.1/lib/ruby/3.2.0/bundler/runtime.rb:44:in `each'
	from /Users/donkey/.rbenv/versions/3.2.1/lib/ruby/3.2.0/bundler/runtime.rb:44:in `require'
	from /Users/donkey/.rbenv/versions/3.2.1/lib/ruby/3.2.0/bundler.rb:195:in `require'
	from /Users/donkey/code/rails/darted/config/application.rb:7:in `<main>'
	from <internal:/Users/donkey/.rbenv/versions/3.2.1/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
	from <internal:/Users/donkey/.rbenv/versions/3.2.1/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
	from /Users/donkey/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
	from /Users/donkey/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/railties-7.0.5/lib/rails/command/actions.rb:22:in `require_application!'
	from /Users/donkey/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/railties-7.0.5/lib/rails/command/actions.rb:14:in `require_application_and_environment!'
	from /Users/donkey/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/railties-7.0.5/lib/rails/commands/generate/generate_command.rb:21:in `perform'
	from /Users/donkey/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/thor-1.2.2/lib/thor/command.rb:27:in `run'
	from /Users/donkey/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/thor-1.2.2/lib/thor/invocation.rb:127:in `invoke_command'
	from /Users/donkey/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/thor-1.2.2/lib/thor.rb:392:in `dispatch'
	from /Users/donkey/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/railties-7.0.5/lib/rails/command/base.rb:87:in `perform'
	from /Users/donkey/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/railties-7.0.5/lib/rails/command.rb:48:in `invoke'
	from /Users/donkey/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/railties-7.0.5/lib/rails/commands.rb:18:in `<main>'
	from <internal:/Users/donkey/.rbenv/versions/3.2.1/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
	from <internal:/Users/donkey/.rbenv/versions/3.2.1/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
	from /Users/donkey/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/bootsnap-1.16.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
	from bin/rails:4:in `<main>'

however,

If I first install trestle with sassc-rails, then remove it and use dartsass-rails, everything works up until I need to compile in production (really weird, really mysterious).

To fix this, I add sassc-rails to my bundle in a production group, and explicitly nil the css_compressor in production.rb:

  # Compress CSS using a preprocessor.
  config.assets.css_compressor = nil

(due to this: https://github.com/sass/sassc-rails/blob/master/lib/sassc/rails/railtie.rb#LL74C56-L74C100)

then everything compiles just fine :)

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

No branches or pull requests

1 participant