Search code examples
herokuruby-on-rails-5

Rails: application.css not in asset pipeline


I know this is a old question but no answer is fixing my problem.

I'm new to Ruby on Rails and just created project with a PostgreSQL database just to be able to upload the project to Heroku.

When i start the rails server im getting the error "application.css is not present in the asset pipeline."

I'm using bootstrap 4 gem and this requires that you rename the applications.css to application.scss.

I dont know what is wrong.

I really tried every answer that is on stackoverflow without any success :(

Please help me, what am i doing wrong?

This is the error im getting: enter image description here


Solution

  • origin answer

    in my case, I forgot to install yarn command in my server.

    so, please install yarn before running rails server. otherwise assets:precompile will do nothing and give no warning.

    update

    also, make sure all of these things:

    1. file exists: app/assets/stylesheets/application.css
    2. its content looks like:
    /* ...
     *= require_self
     *= require_tree .
     */
    
    1. also check file app/assets/config/manifest.js,
    //= link application.css