私は閉じたブログとディスカッション ネットワーク風のアプリに取り組んでいますが、すべて問題ありません。Devise、cancan、ログイン、すべて正常に動作していました。他のユーザーをフォローするためのユーザー/関係モデルの実装を微調整していたときに、サーバーがクラッシュしました。サーバーを実行していたコンソールから出てきたものは次のとおりです。うまくいけば、私がどれほど厄介なコーダーであるかが示されません。この貼り付けがどの程度関連しているかはわかりませんが、実際のクラッシュは一番下にあります。
Started GET "/user/dyylannnn" for 127.0.0.1 at Wed Aug 01 12:12:48 -0400 2012
SQLite3::ConstraintException (columns follower_id, followed_id are not unique):
activerecord (3.2.7) lib/active_record/connection_adapters/sqlite_adapter.rb:69:in `close'
activerecord (3.2.7) lib/active_record/connection_adapters/sqlite_adapter.rb:69:in `dealloc'
activerecord (3.2.7) lib/active_record/connection_adapters/sqlite_adapter.rb:58:in `clear'
activerecord (3.2.7) lib/active_record/connection_adapters/sqlite_adapter.rb:57:in `each'
activerecord (3.2.7) lib/active_record/connection_adapters/sqlite_adapter.rb:57:in `clear'
activerecord (3.2.7) lib/active_record/connection_adapters/sqlite_adapter.rb:144:in `clear_cache!'
activerecord (3.2.7) lib/active_record/connection_adapters/sqlite_adapter.rb:138:in `disconnect!'
activerecord (3.2.7) lib/active_record/connection_adapters/abstract/connection_pool.rb:151:in `clear_reloadable_connections!'
activerecord (3.2.7) lib/active_record/connection_adapters/abstract/connection_pool.rb:149:in `each'
activerecord (3.2.7) lib/active_record/connection_adapters/abstract/connection_pool.rb:149:in `clear_reloadable_connections!'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
activerecord (3.2.7) lib/active_record/connection_adapters/abstract/connection_pool.rb:147:in `clear_reloadable_connections!'
activerecord (3.2.7) lib/active_record/connection_adapters/abstract/connection_pool.rb:386:in `clear_reloadable_connections!'
activerecord (3.2.7) lib/active_record/connection_adapters/abstract/connection_pool.rb:386:in `each_value'
activerecord (3.2.7) lib/active_record/connection_adapters/abstract/connection_pool.rb:386:in `clear_reloadable_connections!'
activerecord (3.2.7) lib/active_record/connection_adapters/abstract/connection_specification.rb:186:in `__send__'
activerecord (3.2.7) lib/active_record/connection_adapters/abstract/connection_specification.rb:186:in `clear_reloadable_connections!'
activerecord (3.2.7) lib/active_record/railtie.rb:96:in `_callback_before_3'
activesupport (3.2.7) lib/active_support/callbacks.rb:429:in `_run__2144987145__prepare__4__callbacks'
activesupport (3.2.7) lib/active_support/callbacks.rb:405:in `send'
activesupport (3.2.7) lib/active_support/callbacks.rb:405:in `__run_callback'
activesupport (3.2.7) lib/active_support/callbacks.rb:385:in `_run_prepare_callbacks'
activesupport (3.2.7) lib/active_support/callbacks.rb:81:in `send'
activesupport (3.2.7) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (3.2.7) lib/action_dispatch/middleware/reloader.rb:74:in `prepare!'
actionpack (3.2.7) lib/action_dispatch/middleware/reloader.rb:64:in `call'
actionpack (3.2.7) lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
actionpack (3.2.7) lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
actionpack (3.2.7) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
railties (3.2.7) lib/rails/rack/logger.rb:26:in `call_app'
railties (3.2.7) lib/rails/rack/logger.rb:16:in `call'
actionpack (3.2.7) lib/action_dispatch/middleware/request_id.rb:22:in `call'
rack (1.4.1) lib/rack/methodoverride.rb:21:in `call'
rack (1.4.1) lib/rack/runtime.rb:17:in `call'
activesupport (3.2.7) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
rack (1.4.1) lib/rack/lock.rb:15:in `call'
actionpack (3.2.7) lib/action_dispatch/middleware/static.rb:62:in `call'
railties (3.2.7) lib/rails/engine.rb:479:in `call'
railties (3.2.7) lib/rails/application.rb:220:in `call'
rack (1.4.1) lib/rack/content_length.rb:14:in `call'
railties (3.2.7) lib/rails/rack/log_tailer.rb:17:in `call'
rack (1.4.1) lib/rack/handler/webrick.rb:59:in `service'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/webrick/server.rb:162:in `start'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/webrick/server.rb:95:in `start'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/webrick/server.rb:92:in `each'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/webrick/server.rb:92:in `start'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/webrick/server.rb:23:in `start'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/webrick/server.rb:82:in `start'
rack (1.4.1) lib/rack/handler/webrick.rb:13:in `run'
rack (1.4.1) lib/rack/server.rb:265:in `start'
railties (3.2.7) lib/rails/commands/server.rb:70:in `start'
railties (3.2.7) lib/rails/commands.rb:55
railties (3.2.7) lib/rails/commands.rb:50:in `tap'
railties (3.2.7) lib/rails/commands.rb:50
script/rails:6:in `require'
script/rails:6
Rendered /Library/Ruby/Gems/1.8/gems/actionpack-3.2.7/lib/action_dispatch/middleware/templates/rescues/_trace.erb (1.2ms)
Rendered /Library/Ruby/Gems/1.8/gems/actionpack-3.2.7/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (1.0ms)
Rendered /Library/Ruby/Gems/1.8/gems/actionpack-3.2.7/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (13.5ms)
/Library/Ruby/Gems/1.8/gems/activerecord-3.2.7/lib/active_record/connection_adapters/sqlite_adapter.rb:69: [BUG] Segmentation fault
ruby 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0]
Abort trap
それで「あれ、おかしいな」って思ってサーバーを再起動したんですけど、もうダメなんです。犯人はDeviseらしい。「current_user が未定義のローカル変数またはメソッドではない」ということでなければ、私のナビゲーション バー (bootstrap ftw) の Devise 実装も壊れているということです。ただし、エラーが何であれ、私のサイトのすべてのページが壊れており、すべてデバイスに関連しているようです.
私は Rails に慣れるためにこのプロジェクトを行っており、とても気に入っています。ヘルプ?皆さんがリクエストする可能性のある他のコードを貼り付けることができます。