I started new project with rails 7 and ruby 3 : rails new erdemsproject --css=bootstrap $rails g controller page index (after that in routes: root “home#index” )
$rails s
And I’m giving a basic error in localhost’s red page:
The asset “application.js” is not present in the asset pipeline.
on the:
<%= javascript_include_tag “application”, “data-turbo-track”: “reload”, defer: true %>
What is the mistake? I installed yarn, npm, npx and ruby again and again. But didn't solve.
in your app/views/layouts/applications.html.erb instead of :
<%= javascript_include_tag "application", "data-turbo-track": "reload", defer: true %>
do :
<%= javascript_include_tag "/assets/application.js", "data-turbo-track": "reload", defer: true %>
For a rails 7 app initialize with css flag you need to run your project with:
./bin/dev
Because you need to build your css and js with cssbundling-rails and jsbundling-rails.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With