我正在开发一个封闭的博客和讨论网络式应用程序,一切都很好;设计,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
所以我就像“嗯,这很奇怪”,然后重新启动了服务器,但现在一切都坏了。肇事者似乎是设计者。如果不是'current_user 不是未定义的局部变量或方法',那是我的导航栏(bootstrap ftw)中的设计实现也被破坏了。但是,无论出现什么错误,我网站上的每个页面都已损坏,而且似乎都与设计有关。
我做这个项目是为了让自己熟悉 Rails,我非常喜欢它,但我还是新手,我不知道 wtf 刚刚发生。帮助?我可以粘贴你们可能要求的任何其他代码。