简体   繁体   中英

Rails-Heroku-SASS Syntax Errors For File

My repo SelfFunder works perfectly fine at my local machine. When I am deploying on Heroku , I observe the errors as shown below:

Error compiling CSS asset

Sass::SyntaxError: File to import not found or unreadable: homepage/key_points.
Load paths:
/app/app/assets/images
/app/app/assets/javascripts
/app/app/assets/stylesheets
/app/vendor/assets/javascripts
/app/vendor/assets/stylesheets
/app/vendor/bundle/ruby/2.0.0/gems/jquery-ui-rails-4.1.0/app/assets/images
/app/vendor/bundle/ruby/2.0.0/gems/jquery-ui-rails-4.1.0/app/assets/javascripts
/app/vendor/bundle/ruby/2.0.0/gems/jquery-ui-rails-4.1.0/app/assets/stylesheets
/app/vendor/bundle/ruby/2.0.0/gems/jquery-ui-rails-3.0.4/app/assets/javascripts
(in /app/app/assets/stylesheets/main.scss:3)

/app/app/assets/stylesheets/homepage.scss:3

I identified the path and observed that homepage/key_points is residing under the following path on my local machine:

/views/preorder/homepage/_key_points.html.erb

Upon modifying the contents of homepage.scss ( as shown below ), Heroku still throws up the same error.

@import "preorder/homepage/key_points";

Appreciate if someone can guide where I am going wrong?

I'm not sure what's your intention there, but you are trying to import a HTML file into a CSS file, which would produce broken CSS if it were successful.

And you can only import files for assets from certain locations ( app/assets , lib/assets or vendor/assets ).

In your case, the clue is on /app/app/assets/images . Notice the double app there. First, please follow the guide on setting up assets compilation for Rails 4 on Heroku .

You seem to be missing gem 'rails_12factor', group: :production on your Gemfile .

I got the issue fixed. I overlooked /assets/stylesheets/homepage directory. It had some .css.scss files which upon renaming to .scss fixed the issue.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM