"" Application.js "is not present in the asset pipeline" error in Ruby on Rails

While watching the video of Ruby on Rails application production on YouTube, I will summarize it as a record because the title error occurred while learning in the local environment.

When implementing the logout function ActionView::Template::Error: The asset "application.js" is not present in the asset pipeline And a javascript file does not exist error occurred.

Upon examination, the cause was a different version of rails. On the video, the development environment is rails: 5.2.4.1, and the Javascript folder is app/assets/javascripts/application.js

But in rails 6 app/javascripts/application.js The place was different.

In the view file head in ails 5.x <%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %> Since it is, I changed it as follows so that application.js can be loaded normally and solved it.

application.html.erb


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

Since it was the first application production in the local environment, I didn't understand anything and executed rails new [project name] according to the video, and started with the latest version.

Recommended Posts

"" Application.js "is not present in the asset pipeline" error in Ruby on Rails
Error in production environment (The asset "~" is not present in the asset pipeline.)
How to resolve the error'ActionView :: Template :: Error (The asset "application.css" is not present in the asset pipeline.'" When precompiling Rails assets
[Ruby on Rails Tutorial] Error in the test in Chapter 3
[Ruby On Rails] Error in test using RSpec MySQL client is not connected
[Rails] About the error that the image is not displayed in the production environment
[Cloud9] Yay! You ’re on Rails! Is not displayed in the rails tutorial
[Error] The app is not displayed in the production environment
[Ruby on rails] When executing the heroku command, bash: heroku: command not found is displayed. [Rails tutorial]
[Ruby on Rails] Quickly display the page title in the browser
Ruby on Rails Japanese-English support i18n
[Ruby on Rails] What is Bcrypt?
Data is not registered in Rails.
The repository ... is not signed error in docker build apt-get update
I summarized the flow until implementing simple_calendar in Ruby on Rails.
Things to remember and concepts in the Ruby on Rails tutorial
[Ruby on Rails] Search function (not selected)
part of the syntax of ruby ​​on rails
Ruby on Rails in Visual Studio Codespaces
Beginners create portfolio in Ruby on Rails
How to debug the processing in the Ruby on Rails model only on the console
Cloud IDE: Heroku couldn't be installed in the Ruby on Rails tutorial
[Ruby on Rails] Solving the addiction when setting crontab using whenever in EC2
[Ruby on Rails] Until the introduction of RSpec
The ruby version is managed in the .rbenv / version file
When the Ruby on Rails terminal rolls back
Recommendation of Service class in Ruby on Rails
The devise error message is not displayed properly.
Publish the app made with ruby on rails
How to resolve errors that occur in the "Ruby on Rails" integration test
Rails new in Ruby on Rails ~ Memorandum until deployment 2
Rails new in Ruby on Rails ~ Memorandum until deployment 1
(Ruby on Rails6) Creating data in a table
Determine the current page with Ruby on Rails
[Ruby on Rails] How to Japaneseize the error message of Form object (ActiveModel)
[Ruby on Rails] How to install Bootstrap in Rails
[Ruby On Rails] When a model unit test is performed with RSpec using FactoryBot, an error occurs because the foreign key is not entered.
When the project is not displayed in eclipse
Ebean.update () is not executed in the inherited model.
[Ruby on Rails] Individual display of error messages
Ruby on Rails Incorrect string value error resolution when posting a form in Japanese
[Ruby On Rails] In the nested state, the description in parentheses written after Prefix in the link_to method
[Ruby on Rails] How to write enum in Japanese
Docker the development environment of Ruby on Rails project
Rails must be exist error (@save is not executed)
[Ruby on Rails] How to change the column name
[Ruby On Rails] How to reset DB in Heroku
[Ruby / Rails] Set a unique (unique) value in the class
[Ruby on Rails] Post image preview function in refile
Solve the N + 1 problem with Ruby on Rails: acts-as-taggable-on
(Ruby on Rails6) Reflecting the posted content from the form
Try using the query attribute of Ruby on Rails
About the asset pipeline
Ruby on Rails Elementary
Ruby on Rails basics
Ruby On Rails Association
What I was interested in in Progate's Ruby on Rails course [Each statement of error message]
[Ruby on Rails] I want to get the URL of the image saved in Active Storage
[Ruby on Rails] credential does not work in production environment even though I saved production.key
Fixed the phenomenon that vuetify built in Rails is not loaded when page transition is done
How to solve the problem when the value is not sent when the form is disabled in rails and sent