Ruby on Railsは初めてです。チュートリアルで 2 つの基本的なデモ アプリを作成しましたlearning by examples
そして突然、新しいサンプル アプリで動作しなくなりました。
コントローラーPages
と 2 つのアクション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:in
initialize' activerecord (3.2.8) lib/active_record/connection_adapters/postgresql_adapter.rb:1213:in
new' activerecord (3.2.8) lib/active_record/connection_adapters/postgresql_adapter.rb:1213:inconnect' activerecord (3.2.8) lib/active_record/connection_adapters/postgresql_adapter.rb:329:in
initialize' activerecord (3.2.8) lib/ active_record/connection_adapters/postgresql_adapter.rb:28: innew' 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/abstract/connection_pool.rb:309: innew_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/abstract/ connection_pool.rb:241: inblock (2 levels) in checkout' activerecord (3.2.8) lib/active_record/connection_adapters/abstract/connection_pool.rb:236:in
loop' activerecord (3.2.8) lib/active_record/connection_adapters/abstract/connection_pool.rb:236: inblock 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
block in connection' /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
connection' activerecord (3.2.8) lib/active_record/connection_adapters /abstract/connection_pool.rb:404:inretrieve_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:connection' activerecord (3.2.8) lib/active_record/query_cache.rb:67:in
呼び出し中のレスキュー' activerecord (3.2.8) lib/active_record/query_cache.rb :61: incall' activerecord (3.2.8) lib/active_record/connection_adapters/abstract/connection_pool.rb:473:in
call' actionpack (3.2.8) lib/action_dispatch/middleware/callbacks.rb:28:inblock in call' activesupport (3.2.8) lib/active_support/callbacks.rb:405:in
run _3261957284442330683_ call _599627944998934036__callbacks' activesupport (3.2.8) lib/active_support/callbacks.rb:405:in__run_callback' activesupport (3.2.8) lib/active_support/callbacks.rb:385:in
_run_call_callbacks' activesupport (3.2.8) lib/active_support/callbacks.rb:81:inrun_callbacks' actionpack (3.2.8) lib/action_dispatch/middleware/callbacks.rb:27:in
call' actionpack (3.2.8) lib/action_dispatch/middleware/reloader.rb:65: incall' actionpack (3.2.8) lib/action_dispatch/middleware/remote_ip.rb:31:in
call' actionpack (3.2.8) lib/action_dispatch/middleware/debug_exceptions.rb:16: incall' actionpack (3.2.8) lib/action_dispatch/middleware/show_exceptions.rb:56:in
call' railties (3.2.8) lib/rails/rack/logger.rb:26: incall_app' railties (3.2.8) lib/rails/rack/logger.rb:16:in
call' actionpack (3.2.8) lib/action_dispatch/middleware/request_id.rb:22: incall' rack (1.4.1) lib/rack/methodoverride.rb:21:in
call' 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:incall' actionpack (3.2.8) lib/action_dispatch/middleware/static.rb:62:in
call' railties (3.2.8) lib/rails/engine.rb:479:incall' railties (3.2.8) lib/rails/application.rb:223:in
call' rack (1.4.1) lib /rack/content_length.rb:14:incall' railties (3.2.8) lib/rails/rack/log_tailer.rb:17:in
call' 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を使用しています(Googleのいくつかのバグはubuntuに関連していたため)
私はSOで同様の質問を見つけましたが、それらはいくつかの高度な段階で経験しているため、いくつかの高度な解決策が含まれています.