[Ruby] When I push to Heroku, I get angry as Precompiling assets failed.

1 minute read

Creating original application.

ruby ‘2.6.5’ rails ‘6.0.0’ mysql2’, ‘0.5.3’

After pushing to Heroku,

remote:!
remote: !Precompiling assets failed.
remote:!
remote: !Push rejected, failed to compile Ruby app.
remote:
remote: !Push failed
remote: Verifying deploy...


  ![remote rejected] master -> master (pre-receive hook declined)
  error: failed to push some refs to'https://git.heroku.com/original app
  Name.git'

I got an error.

With a flashy red letter error! I was upset by Mark, but I immediately investigated. By the way, I accessed the production environment, but of course I can’t update it.

Well, I guess from the text of Precompiling assets failed that it is probably around assets, and I went to see if there was an error statement at the top.

Then there was! The guy who seems to cause the error!

  remote: Sass::SyntaxError: Invalid CSS after "...kground-color: ": expected expression (e.g. 1px, bold), was ";"

Sass::SyntaxError: Invalid I searched based on the CSS and the hint of “…kground-color:”. For the time being, Sass has no touch, so I saw it in CSS.

Background-color:;

No, nothing. .. ..

I checked it locally and it was OK without this property, so I deleted it. But why did you write it? ..

After pushing to the master, triumphantly

% Git push heroku master

Then I got the same error again. .. .. Also, the error is the same, so I checked all the CSS again.

    left: 50%;

The symbols are too far apart. .. ..

   left: 50%;

Change it here and try again

% Git push heroku master

I was successful! !! Was good! !!

As a beginner, I value each error and solve it.