The asset "application.js" is not present in the asset pipeline

first of all try to restart your server, generally there is no need to include application.js file in assets. if it doesn't work then

add below in your config / initializer / assets.rb file:

Rails.application.config.assets.precompile += %w(application.js)

Note: after adding in your assets file, don't forget to restart your server. If you do any changes in Inilalizers, you have to restart the server to see the effects.


I also ran in this error with Rails 6 (with webpack) using the syntax javascript_include_tag in the application.html.erb file.

With rails 6 and webpack use:

<%= javascript_pack_tag 'application', 'data-turbolinks-track': 'reload' %>