gentelella-rails: `File to import not found or unreadable: gentelella` when running assets:precompile in production

When I run this:

RAILS_ENV=production bin/rails assets:precompile

I see this error:

Sass::SyntaxError: File to import not found or unreadable: gentelella.
Load paths:
  /home/ubuntu/.rvm/gems/ruby-2.4.0/gems/bootstrap-sass-3.3.7/assets/stylesheets
  /home/ubuntu/.rvm/gems/ruby-2.4.0/gems/font-awesome-sass-4.7.0/assets/stylesheets

Any idea why?

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 26 (15 by maintainers)

Most upvoted comments

groans Now that’s a frustrating tidbit. CSS doesn’t wring the code through the SASS rendering system. But CSS has it’s own @import functionality, so it’s just trying to include the file directly and not finding it. SASS on the other hand, will import and churn that file into a proper CSS resulting output, and that means dipping into the assets pipeline as needed.

I’ve been using application.scss for so long, it did not even occur to me that this might be your issue. Usually, the first thing I try when setting up a project won’t work even in development until I rename that file and it’s one of the very first things I do in new projects.

@mwlang so this is the facepalm moment. I switched my application.css to application.scss, and it worked. In CSS it would expect a path to existing file, but with scss it just knows to use the gem’s files(?)

Try adding coffeescript to your Rails Gemfile:

gem 'coffee-rails', '~> 4.2'

then “bundle install”

If that works, I know how to fix the gentelella-rails gem!