What to do if you get `rescue in block in modules_for_hoge': Missing hoge file hoge / hoge_hoge.rb (AbstractController :: Helpers :: MissingHogeError) in rails s even though the file is in the specified error location.

Error statement

qiita.rb


/home/ubuntu/.rvm/gems/ruby-2.6.3/gems/actionpack-6.0.3/lib/abstract_controller/helpers.rb:152:in `rescue in block in modules_for_helpers': Missing helper file helpers/microposts_helper.rb (AbstractController::Helpers::MissingHelperError)
        from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/actionpack-6.0.3/lib/abstract_controller/helpers.rb:149:in `block in modules_for_helpers'
        from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/actionpack-6.0.3/lib/abstract_controller/helpers.rb:145:in `map!'
        from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/actionpack-6.0.3/lib/abstract_controller/helpers.rb:145:in `modules_for_helpers'
        from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/actionpack-6.0.3/lib/action_controller/metal/helpers.rb:94:in `modules_for_helpers'
        from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/actionpack-6.0.3/lib/abstract_controller/helpers.rb:109:in `helper'
        from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/actionpack-6.0.3/lib/action_controller/railties/helpers.rb:19:in `inherited'
        from /home/ubuntu/environment/sample_app/app/controllers/application_controller.rb:1:in `<main>'
        from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require'
        from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
        from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
        from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
        from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
        from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/zeitwerk-2.4.0/lib/zeitwerk/kernel.rb:27:in `require'
        from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/actiontext-6.0.3/lib/action_text/engine.rb:47:in `block (2 levels) in <class:Engine>'
        from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.3/lib/active_support/callbacks.rb:428:in `instance_exec'
        from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.3/lib/active_support/callbacks.rb:428:in `block in make_lambda'
        from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.3/lib/active_support/callbacks.rb:200:in `block (2 levels) in halting'
        from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.3/lib/active_support/callbacks.rb:605:in `block (2 levels) in default_terminator'
        from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.3/lib/active_support/callbacks.rb:604:in `catch'
        from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.3/lib/active_support/callbacks.rb:604:in `block in default_terminator'
        from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.3/lib/active_support/callbacks.rb:201:in `block in halting'
        from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.3/lib/active_support/callbacks.rb:513:in `block in invoke_before'
        from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.3/lib/active_support/callbacks.rb:513:in `each'
        from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.3/lib/active_support/callbacks.rb:513:in `invoke_before'
        from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.3/lib/active_support/callbacks.rb:134:in `run_callbacks'
        from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.3/lib/active_support/execution_wrapper.rb:119:in `complete!'
        from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.3/lib/active_support/execution_wrapper.rb:90:in `wrap'
        from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.3/lib/active_support/reloader.rb:51:in `reload!'
        from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/lib/spring/application.rb:168:in `serve'
        from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/lib/spring/application.rb:145:in `block in run'
        from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/lib/spring/application.rb:139:in `loop'
        from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/lib/spring/application.rb:139:in `run'
        from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/spring-2.1.0/lib/spring/application/boot.rb:19:in `<top (required)>'
        from /home/ubuntu/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
        from /home/ubuntu/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
        from -e:1:in `<main>'

approach

I did a bundle update and was able to test it again with rails s.

Recommended Posts

What to do if you get `rescue in block in modules_for_hoge': Missing hoge file hoge / hoge_hoge.rb (AbstractController :: Helpers :: MissingHogeError) in rails s even though the file is in the specified error location.
What to do if you get a "Mysql2 :: Error: Operand should contain 1 column (s)" error in Rails
What to do if you get an "A server is already running." Error when you try to start the rails server
[Rails] What to do if you can't get an error message with the errors method
What to do if you get a "302" error in your controller unit test code in Rails
What to do if you get an error in Basic authentication during Rails test code
What to do if you get a gcc error in Docker
What to do if Cloud9 is full in the Rails tutorial
What to do if you get a DISPLAY error in gym.render ()
What to do if you get an error during rails db: reset
What to do if you get a SQLite3 :: BusyException: database is locked error
What to do if you get the error message unrecognized selector send to instance "***"
What to do if you get To install the missing version, run `gem install bundler: 2.1.4`
[Rails] What to do if you get an error saying "Could not find a JavaScript runtime." When executing the rails s command on Catalina
What to do if you get a wrong number of arguments error in binding.pry
What to do if you can't get the text of an element in Selenium
What to do if you get the error Couldn't find Item without an ID
What to do if you get the warning "Uniqueness validator will no longer enforce case sensitive comparison in Rails 6.1." in Rails 6.0
What to do if you get angry with "ERROR: There are no scenarios; must have at least one" even though you should have entered yarn in Docker
What to do if you don't see the test code error message in the terminal console
[Rails] What to do if you accidentally install bundle in the production environment in your local environment
What to do if you get a java.io.IOException in GlassFish
What to do if you can't use the rails command
[Programming beginner] What to do when rails s becomes an error in the local development environment
[Note] What to do if bundle install in Chapter 3 of the rails tutorial is not possible
What to do if you get a JNI shared library error when trying to build in Eclipse
What to do if you get an [An HTTP request took too long to complete.] Error in Docker.
[Rails] What to do if data is not registered in DB
What to do if the Rails page doesn't appear in Rails tutorial 1.3.2
What to do if you forget the root password in CentOS7
[Rails] What to do if you can't get parameters with form_with
What to do if you get an error with bundle install by entering gem'bcrypt' in your Gemfile
What to do if the image posted by refile disappears after setting a 404 error page in Rails
What to do if you can't bundle update and bundle install after installing Ruby 3.0.0 in the Rails tutorial
What to do if Operation not permitted is displayed when you execute a command in the terminal
What to do if you get the error Too long with no output (exceeded 10m0s) on CircleCI
What to do if the prefix c is not bound in JSP
What to do if you get an uninitialized constant Likes Controller error
What to do if you get an error when you hit Heroku logs
What to do if you get a javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake in the IBM JDK
What to do if you get Could not save master table to file after importing a project in Eclipse
If you get the error The data ca n’t be read because it is missing in docker for mac
How to translate the error message into Japanese (What to do if you cannot log in for some reason)
What to do if you get an error on heroku rake db: migrate
[Java] What to do if you get an error in Eclipse saying "Not allowed at source level below 1.X"
What to do if you get an Argument Error: wrong number of arguments (given 2, expected 0) in your RSpec test
What to do if you get an error saying "Please enter a valid value" when getting with Rails datetime_field
What to do if you get an error saying "Could not find a JavaScript runtime." When starting rails server
[Solution] What to do if you get a Docker error'ERROR: Cannot connect to the Docker daemon at unix: ///var/run/docker.sock. Is the docker daemon running?'
What to do when Address already in use is displayed after executing rails s
What to do if you get a port error when docker-compose up on Mac
[Maven] What to do if you are asked to incorporate a jar that is not in the remote repository into the war
What to do if you select a JRE in Eclipse and get "The selected JRE does not support the current compliance level 11"
[Rails Tutorial Chapter 2] What to do when you make a mistake in the column name
What to do if you get a "Cannot Pull Container Error" when starting ECS ​​Fargate
What you need to do to open a file from the menu in the document-Based App macOS app
What to do if Could not find hoge in any of the sources Run `bundle install` to install missing gems. Appears in the docker container