I ran a command to create a new model, but I get the following error and cannot create a model.
ubuntu: ~/environment/first_app (master) $rails g model Country name: string
/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>': uninitialized constant ActionText :: Engine :: ApplicationController (NameError)
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:76: in `ensure in block in run!'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.3/lib/active_support/execution_wrapper.rb:76: in `block in run!'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.3/lib/active_support/execution_wrapper.rb:70:in `tap'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.3/lib/active_support/execution_wrapper.rb:70:in `run!'
from /home/ubuntu/.rvm/gems/ruby-2.6.3/gems/activesupport-6.0.3/lib/active_support/execution_wrapper.rb:86: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>'
What I tried
PC restart
EC2 restart
Change browser from chrome to safari
The reason I tried the above three is because I thought there was a problem with cloud9 itself.
That's because something is written on the top line of the error.
/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>': uninitialized constant ActionText :: Engine :: ApplicationController (NameError)
There seemed to be an error in the ApplicationController, so I was curious and tried to look into the file.
But I can't open the file. As shown in the image below, the backslash next to the file name continues around.
By convention, only "when opening the application_controller.rb file" is not loaded.
So, I tried the above three to solve the phenomenon that only the application_controller.rb file cannot be opened, but none of them solves the problem. If the file is read properly, I think that the error when creating the model can be eliminated.
If anyone is familiar with this, please help.
-
Answer # 1
Related articles
- ruby on rails - i can't create a model with rails
- ruby on rails - unable to create controller
- ruby - [rails] i want to create a link including the data attribute with the link_to helper
- ruby on rails - i get an error with rails db: create
- ruby on rails 5 - child model record not created
- ruby on rails - i'm trying to create a container in docker but it doesn't work i want to create a container
- ruby on rails 5 - rails: i want to create a timetable app
- ruby on rails - the link between the model created by devise and the model originally created does not work
- ruby - [rails] i want to find the date difference using the model created_at
- ruby on rails - about the code of the adjacency list model implemented in rails
- ruby - unable to access server with rails s
- ruby on rails - product model test code does not succeed
- ruby on rails - unable to install direnv
- ruby on rails - rails associated model is not saved in db
- ruby - [rails] i want to create an image link using the url of the image output using active storage
- ruby - rails unable to resolve user errors
- [ruby on rails] i want to display a parent model that matches the information of the associated child model
- ruby - unable to create table with foreign key
- ruby - unable to open rails server
- ruby - an error occurred when implementing the micropost search function using ransack
- ruby - sass :: syntaxerror on rails s
- ruby - i started the server in rails s but can't open it
- php - vfs connection does not exist is displayed
- aws lambda can't load ruby gems
- html - how to proceed with learning and development for ec construction
- ruby - behavior that i do not know if rails can be started with unicorn
- ruby - aws deployment the asset "" is not present in the asset pipeline cannot be resolved
- ruby - resource: the server responded with a status of 404 () error
- aws - i can't re-login to the wordpress dashboard in cloud9
Over time, the phenomenon of not being able to open files has not changed.
I couldn't help it, so I created another new environment and started coding again.
As a result, it is working well now.