简体   繁体   中英

Deploy to Heroku Failing on Rails Upgrade from 6.0 to 6.1 - SassC::SyntaxError: Error: File to import not found or unreadable

I've recently upgraded to latest rails. The upgrade was from 6.0.3.4 to 6.1.3.1.

Everything in development and Production/Heroku worked great prior to the upgrade. Now everything works fine in development (local machine), but fails the rails assets:precompile step on Heroku with the following error message:

remote: -----> Installing node-v12.16.2-linux-x64
remote: -----> Installing yarn-v1.22.4
remote: -----> Detecting rake tasks
remote: -----> Preparing app for Rails asset pipeline
remote:        Running: rake assets:precompile
remote:        rake aborted!
remote:        SassC::SyntaxError: Error: File to import not found or unreadable: bootstrap/scss/bootstrap.
remote:                on line 21:1 of app/assets/stylesheets/application.scss
remote:        >> @import "bootstrap/scss/bootstrap";

My understanding is that the standard functionality is that it will look in local relative files first, then the node_modules folder.

What is my problem here?

I've recently upgraded to latest rails. The upgrade was from 6.0.3.4 to 6.1.3.1.

Everything in development and Production/Heroku worked great prior to the upgrade. Now everything works fine in development (local machine), but fails the rails assets:precompile step on Heroku with the following error message:

remote: -----> Installing node-v12.16.2-linux-x64
remote: -----> Installing yarn-v1.22.4
remote: -----> Detecting rake tasks
remote: -----> Preparing app for Rails asset pipeline
remote:        Running: rake assets:precompile
remote:        rake aborted!
remote:        SassC::SyntaxError: Error: File to import not found or unreadable: bootstrap/scss/bootstrap.
remote:                on line 21:1 of app/assets/stylesheets/application.scss
remote:        >> @import "bootstrap/scss/bootstrap";

My understanding is that the standard functionality is that it will look in local relative files first, then the node_modules folder.

What is my problem here?

I've recently upgraded to latest rails. The upgrade was from 6.0.3.4 to 6.1.3.1.

Everything in development and Production/Heroku worked great prior to the upgrade. Now everything works fine in development (local machine), but fails the rails assets:precompile step on Heroku with the following error message:

remote: -----> Installing node-v12.16.2-linux-x64
remote: -----> Installing yarn-v1.22.4
remote: -----> Detecting rake tasks
remote: -----> Preparing app for Rails asset pipeline
remote:        Running: rake assets:precompile
remote:        rake aborted!
remote:        SassC::SyntaxError: Error: File to import not found or unreadable: bootstrap/scss/bootstrap.
remote:                on line 21:1 of app/assets/stylesheets/application.scss
remote:        >> @import "bootstrap/scss/bootstrap";

My understanding is that the standard functionality is that it will look in local relative files first, then the node_modules folder.

What is my problem here?

You can probably run test it locally

NODE_ENV=production bundle exec rails assets:precompile 

then run

rake assets:precompile

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