简体   繁体   English

引发ConnectionNotFounded,“未找到带有'#{spec_name}'的连接池。”除非池LOCALHOST3000不起作用

[英]raise ConnectionNotEstablished, “No connection pool with '#{spec_name}' found.” unless pool LOCALHOST3000 not working

  def retrieve_connection(spec_name) #:nodoc:
    pool = retrieve_connection_pool(spec_name)
    raise ConnectionNotEstablished, "No connection pool with '#{spec_name}' found." unless pool
    pool.connection
  end

I am working on a web app from scratch and found lots of errors in the ruby on rails code above. 我正在从头开始开发Web应用程序,并且在上面的Rails代码中的ruby中发现了很多错误。 I installed all the gems required and install and connected home page in controller and route.rb but I can't find the solution for this problem. 我安装了所有必需的gem,并在controller和route.rb中安装并连接了主页,但是找不到该问题的解决方案。

activerecord (5.2.2) lib/active_record/connection_adapters/abstract/connection_pool.rb:1009:in `retrieve_connection'
activerecord (5.2.2) lib/active_record/connection_handling.rb:118:in `retrieve_connection'
activerecord (5.2.2) lib/active_record/connection_handling.rb:90:in `connection'
activerecord (5.2.2) lib/active_record/migration.rb:554:in `call'
actionpack (5.2.2) lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
activesupport (5.2.2) lib/active_support/callbacks.rb:98:in `run_callbacks'
actionpack (5.2.2) lib/action_dispatch/middleware/callbacks.rb:26:in `call'
actionpack (5.2.2) lib/action_dispatch/middleware/executor.rb:14:in `call'
actionpack (5.2.2) lib/action_dispatch/middleware/debug_exceptions.rb:61:in `call'
web-console (3.7.0) lib/web_console/middleware.rb:135:in `call_app'
web-console (3.7.0) lib/web_console/middleware.rb:30:in `block in call'
web-console (3.7.0) lib/web_console/middleware.rb:20:in `catch'
web-console (3.7.0) lib/web_console/middleware.rb:20:in `call'
actionpack (5.2.2) lib/action_dispatch/middleware/show_exceptions.rb:33:in `call'
railties (5.2.2) lib/rails/rack/logger.rb:38:in `call_app'
railties (5.2.2) lib/rails/rack/logger.rb:26:in `block in call'
activesupport (5.2.2) lib/active_support/tagged_logging.rb:71:in `block in tagged'
activesupport (5.2.2) lib/active_support/tagged_logging.rb:28:in `tagged'
activesupport (5.2.2) lib/active_support/tagged_logging.rb:71:in `tagged'
railties (5.2.2) lib/rails/rack/logger.rb:26:in `call'
sprockets-rails (3.2.1) lib/sprockets/rails/quiet_assets.rb:13:in `call'
actionpack (5.2.2) lib/action_dispatch/middleware/remote_ip.rb:81:in `call'
actionpack (5.2.2) lib/action_dispatch/middleware/request_id.rb:27:in `call'
rack (2.0.6) lib/rack/method_override.rb:22:in `call'
rack (2.0.6) lib/rack/runtime.rb:22:in `call'
activesupport (5.2.2) lib/active_support/cache/strategy/local_cache_middleware.rb:29:in `call'
actionpack (5.2.2) lib/action_dispatch/middleware/executor.rb:14:in `call'
actionpack (5.2.2) lib/action_dispatch/middleware/static.rb:127:in `call'
rack (2.0.6) lib/rack/sendfile.rb:111:in `call'
railties (5.2.2) lib/rails/engine.rb:524:in `call'
puma (3.12.0) lib/puma/configuration.rb:225:in `call'
puma (3.12.0) lib/puma/server.rb:658:in `handle_request'
puma (3.12.0) lib/puma/server.rb:472:in `process_client'
puma (3.12.0) lib/puma/server.rb:332:in `block in run'
puma (3.12.0) lib/puma/thread_pool.rb:133:in `block in spawn_thread'

Check your database.yml file for invisible characters that might be throwing off the spacing. 检查您的database.yml文件中是否存在可能会引起间距问题的不可见字符。 That'll produce the error you're referencing. 这会产生您所引用的错误。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 ActiveRecord::ConnectionNotEstablished(未找到“主”连接池。) - ActiveRecord::ConnectionNotEstablished (No connection pool with 'primary' found.) 呈现结果时,ActiveRecord::ConnectionNotEstablished(未找到具有“主要”的连接池。) - ActiveRecord::ConnectionNotEstablished (No connection pool with 'primary' found.) when rendering results ActiveRecord::ConnectionNotEstablished:在登台时找不到“阅读”角色的“主要”连接池 - ActiveRecord::ConnectionNotEstablished: No connection pool with 'primary' found for the 'reading' role on staging ActiveRecord :: ConnectionNotEstablished - 没有X的连接池 - ActiveRecord::ConnectionNotEstablished - No connection pool for X ActiveRecord::ConnectionNotEstablished: ActiveRecord::Base with mongoid 没有连接池 - ActiveRecord::ConnectionNotEstablished: No connection pool for ActiveRecord::Base with mongoid `retrieve_connection':没有模型的连接池(ActiveRecord :: ConnectionNotEstablished) - `retrieve_connection': No connection pool for Model (ActiveRecord::ConnectionNotEstablished) ROR - ActiveRecord::ConnectionNotEstablished: PublicActivity::ORM::ActiveRecord::Activity 没有连接池 - ROR - ActiveRecord::ConnectionNotEstablished: No connection pool for PublicActivity::ORM::ActiveRecord::Activity 没有找到主要的连接池 - no connection pool with primary found 没有找到“主要”的连接池 - No connection pool with 'primary' found {model name} 没有连接池 - No connection pool for {model name}
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM