Brand new Rails 7.0 App - "The asset "application.js" is not present in the asset pipeline."

Created a new app with

rails new my_new_app -d postgresql -c sass

Added the sass script to package.json, generated a controller and a view, created the database and ran

yarn build:css --watch & rails s (SASS was not getting compiled without the first part)

At this point, I get

Sprockets::Rails::Helper::AssetNotFound in Home#index
The asset "application.js" is not present in the asset pipeline.

on the

<%= javascript_include_tag "application", "data-turbo-track": "reload", defer: true %>

What am I missing?

Just run into the same problem, Not sure if its the right approach or not, but what i did to make it work was to move the javascript folder to the assets folder, then in "assets/config/manifest.js " file added this:

//= link_directory /…/javascript .js

And it worked.

1 Like

Thanks. This helped with problem in Rails 6. Gave the clue I needed. Different path

1 Like

Hey thanks for sharing this post i was having some issues is your issue solved because i am not getting mine answer.