-
Notifications
You must be signed in to change notification settings - Fork 106
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
Comments
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:
|
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 ? |
JFI: You can put the |
Thank you !! This worked, and the assets are compiled a lot quicker now 👍 |
Nice! You're welcome. I'd love to see that it works in a way that the |
I just tried this myself, and it turned out what mattered wasn't putting it before FWIW, this SO answer explains why the |
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. |
Strangely this still is a problem for me in a new rails 6.0.0 app and moving I also don't seem to have an assets block in my Gemfile. This is what the Gemfile looks like:
This is the exception stacktrace:
|
@amitsaxena Have you tried running Then run: |
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
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
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
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
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
Thank you it solved my problem! |
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, Simply adding |
In All I did was to uncomment it, run
|
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 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
I have searched my app for any further references to sass but can't find any. |
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
LoadError in HomeController#index cannot load such file -- sassc Extracted source (around line #9): getting erroe |
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
The text was updated successfully, but these errors were encountered: