我是Ruby on Rails的新手。我已经创建了两个基本的演示应用程序,按教程learning by examples
PG ::错误服务器意外关闭连接
突然停止工作,我的新示例应用程序。
我已经生成了一个控制器Pages
和两个动作home
和contact
并没有什么奇特的。
现在,我无法打开任何页面,除了默认的index.html rails页面localhost:3000
。 localhost:3000/pages/home
和localhost:3000/pages/contact
的页面返回此错误。
PG ::错误
服务器关闭了连接意外这可能意味着服务器 异常之前终止或在处理请求。
,有时(通常当我重新启动的PostgreSQL)
PG ::错误
服务器关闭了连接意外这可能意味着服务器 异常之前终止或在处理请求。 无法发送的启动包:断的管
这是我的堆栈跟踪
的ActiveRecord(3.2.8) 的lib/active_record/connection_adapters/postgresql_adapter.rb:1213:在
initialize' activerecord (3.2.8) lib/active_record/connection_adapters/postgresql_adapter.rb:1213:in
(3.2.8) lib/active_record/connection_adapters/postgresql_adapter.rb:1213:在connect' activerecord (3.2.8) lib/active_record/connection_adapters/postgresql_adapter.rb:329:in
初始化'activerecord(3.2.8) lib/active_record/connection_adapters/postgres ql_adapter.rb:28:在new' activerecord (3.2.8) lib/active_record/connection_adapters/postgresql_adapter.rb:28:in
postgresql_connection的ActiveRecord(3.2.8) LIB/active_record/connection_adapters /抽象/ connection_pool.rb:309:在new_connection' activerecord (3.2.8) lib/active_record/connection_adapters/abstract/connection_pool.rb:319:in
checkout_new_connection的ActiveRecord(3.2.8) LIB/active_record/connection_adapters /抽象/ connection_pool.rb:241:在block (2 levels) in checkout' activerecord (3.2.8) lib/active_record/connection_adapters/abstract/connection_pool.rb:236:in
环的ActiveRecord(3.2.8) LIB/active_record/connection_adapters /抽象/ connection_pool.rb:236:在block in checkout' /home/jashwant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/monitor.rb:211:in
mon_synchronize的ActiveRecord(3.2.8) LIB/active_record/connection_adapters/abstract/connection_pool.rb:233:checkout' activerecord (3.2.8) lib/active_record/connection_adapters/abstract/connection_pool.rb:96:in
连接中的块' /home/jashwant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby /1.9.1/monitor.rb:211:inmon_synchronize' activerecord (3.2.8) lib/active_record/connection_adapters/abstract/connection_pool.rb:95:in
连接的ActiveRecord(3.2.8) LIB/active_record/connection_adapters /抽象/ connection_pool.rb:404:在retrieve_connection' activerecord (3.2.8) lib/active_record/connection_adapters/abstract/connection_specification.rb:170:in
retrieve_connection的ActiveRecord(3.2.8) LIB /active_record/connection_adapters/abstract/connection_specification.rb:144:inconnection' activerecord (3.2.8) lib/active_record/query_cache.rb:67:in
营救呼叫的ActiveRecord (3.2.8)LIB/active_record/query_cache.rb:61:在call' activerecord (3.2.8) lib/active_record/connection_adapters/abstract/connection_pool.rb:473:in
呼叫'ActionPack的(3.2.8) LIB/action_dispatch /中间件/回调。RB:28:在block in call' activesupport (3.2.8) lib/active_support/callbacks.rb:405:in
运行 _3261957284442330683_ 呼叫 _599627944998934036__callbacks' 的ActiveSupport(3.2.8)LIB/active_support/callbacks.rb:405:在__run_callback' activesupport (3.2.8) lib/active_support/callbacks.rb:385:in
_run_call_callbacks' 的ActiveSupport(3.2.8)LIB/active_support /回调。 RB:81:在run_callbacks' actionpack (3.2.8) lib/action_dispatch/middleware/callbacks.rb:27:in
呼叫 'ActionPack的 (3.2.8)LIB/action_dispatch /中间件/ reloader.rb:65:在call' actionpack (3.2.8) lib/action_dispatch/middleware/remote_ip.rb:31:in
呼叫' ActionPack的(3.2.8) LIB/action_dispatch /中间件/ debug_exceptions.rb:16 :在call' actionpack (3.2.8) lib/action_dispatch/middleware/show_exceptions.rb:56:in
调用' railties(3.2.8)lib/rails/rack/logger.rb:26:在call_app' railties (3.2.8) lib/rails/rack/logger.rb:16:in
调用'actionpack(3.2.8) lib/action_dispatch/middleware/request_id.rb:22:在call' rack (1.4.1) lib/rack/methodoverride.rb:21:in
调用'rack(1.4.1) lib/rack/runtime.rb:17:incall' activesupport (3.2.8) lib/active_support/cache/strategy/local_cache.rb:72:in
call'rack (1.4.1)lib/rack/lock .rb:15:在call' actionpack (3.2.8) lib/action_dispatch/middleware/static.rb:62:in
调用'railties(3.2.8) lib/rails/engine.rb:479:在call' railties (3.2.8) lib/rails/application.rb:223:in
调用'rack(1.4.1) lib/rack/content_length.rb:14:在call' railties (3.2.8) lib/rails/rack/log_tailer.rb:17:in
调用'rack(1.4.1) lib/rack/handler/webrick.rb:59:inservice' /home/jashwant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/webrick/httpserver.rb:138:in
service' /home/jashwant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1 /webrick/httpserver.rb:94:inrun' /home/jashwant/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/webrick/server.rb:191:in
block in start_thread'
我现在不使用数据库。我试图做rake db:migrate
,但它返回相同的错误。
我在Ubuntu 12.04(如在谷歌的一些错误进行了相关的Ubuntu)
我发现在如此相似的问题,但它们在一些推进阶段经历,因此涉及到一些提前的解决方案。
检查PostgreSQL错误日志以获取更多信息。 –
我找到了答案,并在下面指定。 – Jashwant
这个问题奇怪的错误。它应该一直给你“连接拒绝”。 “意外关闭连接”表明您设法获得了一个连接,然后用TCP RST或FIN关闭连接。奇怪的。 –