Skip to main content

Command Palette

Search for a command to run...

Rails 7 error - Sprockets::Rails::Helper::AssetNotFound in

Published
1 min read
Rails 7 error - Sprockets::Rails::Helper::AssetNotFound in
A

I'm a passionate software developer.


Error

Full error

Sprockets::Rails::Helper::AssetNotFound in Pages#home
Showing /home/elitebughunter/www/ebh/my-app Extracted source (around line #10):

/app/views/layouts/application.html.erb where line #10 raised:
The asset "application.js" is not present in the asset pipeline.

    <%= stylesheet_link_tag "application", "data-turbo-track": "reload" %>
    <%= javascript_include_tag "application", "data-turbo-track": "reload", type: "module" %>
  </head>
  <body>

Snapshot


Situation

In a new Rails 7 application, after running rails server or ./bin/dev, it shows that view page error.

The problem seems to be in the application.html.erb:10 file.


Context

Gemfile

Main layout file


Solution

In the application.html.erb:10, change from application to turbo.


Test it


Done


Celebrate

The It Crowd Birthday GIFs | Tenor


Reach me out


Final thoughts

Thank you for reading this article.

If you have any questions, thoughts, suggestions, or corrections, please share them with us.

We appreciate your feedback and look forward to hearing from you.

Feel free to suggest topics for future blog articles. Until next time!


More from this blog

Alexandre Calaça's Blog

265 posts

I'm a passionate software engineer with a deep love for turning complex problems into elegant solutions through code.