What to do when "call'Hoge.connection' to establish a connection" appears on rails c

problem

[1] pry(main)> Hoge
=> Gravure::Series::Publics (call 'Hoge.connection' to establish a connection)

Solution

[2] pry(main)> Hoge.clear_cache!
   [writing](3.7ms)  SET NAMES utf8mb4,  @@SESSION.sql_mode = CONCAT(CONCAT(@@sql_mode, ',STRICT_ALL_TABLES'), ',NO_AUTO_VALUE_ON_ZERO'),  @@SESSION.sql_auto_is_null = 0, @@SESSION.wait_timeout = 2147483
=> nil

Solved by running .clear_cache!

Recommended Posts

What to do when "call'Hoge.connection' to establish a connection" appears on rails c
What to do when Blocked Host: "host name" appears in Ruby on Rails
What to do when rails creates a 〇〇 2.rb file
What to do when a javax.el.PropertyNotWritableException occurs
[Ruby / Rails] What to do when NoMethodError appears when using a destructive method such as filter!
Notes on what to do when a WebView ClassNotFoundException occurs in JavaFX 12
What to do when "Nil location provided. Can't build URI." Appears on CarrierWave
What to do when a null byte error occurs
What to do if you get a NoClassDefFoundError when trying to run eclipse on Java9
What to do if you get a port error when docker-compose up on Mac
What to do when you launch an application with rails
What to do when a could not find driver appears when connecting to a DB in a Docker environment
[Rails Tutorial Chapter 2] What to do when you make a mistake in the column name
What to do when Rails on Docker does not reflect controller changes in the browser
What to do when javax.batch.operations.JobStartException occurs
[Rails 6] What to do when a missing a template error occurs after introducing haml [Super easy]
What to do when an UnsupportedCharsetException occurs in a lightweight JRE
[Rails] What to do when rails s does not respond or does not stop
What to do when you become a Problem During Content Assist
What to do when you run into a docker-compose node_modules problem
[Rails] What to do when the error No database selected and Unknown database appears in db: migrate
What to do when javax.el.ELException: Not a Valid Method Expression: appears when the JSF screen is displayed
What to do when CentOS cannot be started with VirtualBox on Catalina
Notes on what to do when EC2 is set up with t2.micro
What to do if you get a MiniMagick vulnerability alert on GitHub
What to do when you want to delete a migration file that is "NO FILE"
<f: ajax> Unable to attach <f: ajax> to non-ClientBehaviorHolder What to do when you become a parent
[Rails] How to write when making a subquery
A story that took time to establish a connection
What to do when rails db: seed does not reflect in the database
What to do if you get an "A server is already running." Error when you try to start the rails server
[Rails] When transitioning to a page with link_to, move to the specified location on the page
What do you use when converting to String?
What to do when is invalid because it does not start with a'-'
What to do if the rails server doesn't run out on AWS cloud9
What to do if ffi installation fails when launching an application in Rails
[Ubuntu] What to do when MongoDB cannot be started due to a SocketException error
What to do when ‘Could not find’ in any of the sources appears in the development environment with Docker × Rails × RSpec
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
What to do when booting Ubuntu on WSL2 and getting "Process terminated with code 1"
After installing'devise''bootstrap' of gemfile with rails, what to do when url is an error
What to do when Address already in use is displayed after executing rails s
[Ruby on Rails] How to stop when Rails server cannot be stopped by Ctrl + C
What to do if the Rails server can't start
What to do when The SSL certificate has expired
What to do if ClassNotFoundException occurs when starting Tomcat
What to do if rails server can't be stopped
What to do if TextToSpeech doesn't work on Android 11
What to do if you accidentally create a model
What to see when IntelliJ doesn't start on Mac
Error ExecJS :: RuntimeUnavailable: What to do when it occurs
ParseException: What to do when Unparseable date is reached
What to do when an error (StandardError: An error has occurred, this and all later migrations canceled:) appears in rails db: migrate
<Dot installation> What to do if you cannot proceed due to an error when building a development environment for Rails learning.
[Joke] What to do when the invalid sample rate is reached when using Mixxx on Ubuntu 20.04
[Ruby on Rails] I get a warning when executing RSpec due to a different gem version.
What to do when Cannot format given Object as a Date in convertDateTime of JSF
What to do if you get a "Cannot Pull Container Error" when starting ECS ​​Fargate
What to do if you get a "302" error in your controller unit test code in Rails
What to do when it becomes Unable to find CDI BeanManager.