Rails: application.css not in asset pipeline
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:
- file exists:
app/assets/stylesheets/application.css
- its content looks like:
/* ...
*= require_self
*= require_tree .
*/
- also check file
app/assets/config/manifest.js
,
//= link application.css
RoR App: The asset 'application.css' is not present in the asset pipeline after moving to production server
You can confirm your app/assets/stylesheets folder it should have application.css file and you will have to precompile assets in production environment before go/start server in production environment.
You can precompile assets using
RAILS_ENV=production rails assets:precompile
If it still does not work then you can try the config.assets.compile option to true in production.rb so it will do live compilation. Although it should be false in production environment as it impact on performance.
config.assets.compile = true
ActionView::Template::Error (The asset *.css is not present in the asset pipeline.):
In case anyone comes across this and no other posts are helping..
Here are the steps after cloning and app, and adding new git remote to use for heroku...
- add stylesheets to assets.rb
- precompile locally
- push to heroku
I kept pushing to heroku just after adding it to the assets.rb which i could not understand why that wouldn't work.
Heroku rake assets:precompile don't run build:css - application.css is not present in the asset pipeline
SOLVED
Renamed
From
app/assets/stylesheets/application.saas.scss
to
app/assets/stylesheets/application.scss
and updated package.json
"build:css": "sass ./app/assets/stylesheets/application.scss ./app/assets/builds/application.css --no-source-map --load-path=node_modules"
Rails - Asset is not present in asset pipeline when using image_tag
The asset "aussen" is not present in the asset pipeline.
Technically true because you have not aussen
but you have aussen.jpg
so it will be <%= image_tag("aussen.jpg") %>
Look, while you use <%= image_tag("aussen") %>
then it will be genarate HTML like this
<%= image_tag("aussen") %>
#=> <img alt="Aussen" src="/assets/aussen" />
While you use <%= image_tag("aussen.jpg") %>
then it will be genarate HTML like this
<%= image_tag("aussen.jpg") %>
#=> <img alt="Aussen" src="/assets/aussen.jpg" />
When it's going into production mode then it will be shown some encrypted key on the page source like this
aussen-d2fb0029a12281121a1752c599e715a8e2b3db17f1e8e18248a79a7b1ca63b91.jpg
image_tag
AssetTagHelper
see this for reference.
Update production.rb
file config.assets.compile
false
to true
# config/environments/production.rb
...
config.assets.compile = true
...
Related Topics
Ionic-Item Color and Href Not Working
Springboot - Resource Interpreted as Stylesheet But Transferred with Mime Type Text/Htm
Why Does Svg Get Blurred When Scaled Under Webkit Browsers
React Testing Library (Rtl): Test a Responsive Design
Load Different CSS Rule Depending on The Browser in an Angular 4 Component
How to Use The Display:Inline with Text-Align: Right
Actionview::Template::Error (Variable @Fontawesomeeotpath_Iefix Is Undefined)
How to Offset Line-Height Base Line
How to Set Super Thin "Font-Weight" (Less Than 100) in CSS
Label: Hover Attribute Triggers Incorrect Element in Ie10 and Ie11
Ipad Mini Specfic CSS Media Queries
How to Use CSS to Justify Text with Hyphenating Words at The End of a Line
Styling The First 10 Items in a List