如何读取与Lockdown gem相关的失败Rails迁移的跟踪

时间:2009-12-01 11:39:47

标签: ruby-on-rails stack-trace

通常,当我收到错误时,跟踪将指向我自己的代码中的一行。我将转到该行,找到错误并修复它。

但是,现在跟踪指向Rails和gem代码,我不知道如何使用它来调试我的工作。

我一直在按照here列出的步骤进行操作。

当我运行rake db:migrate --trace时,我得到如下所示的踪迹。我不是要求任何人为我调试它,但我很感激你在调试它时会想到的任何指针。

rake db:migrate --trace
(in /Users/steven/Drominay)
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
=> Mixing in Lockdown version: 1.6.2 

rake aborted!
uninitialized constant Lockdown::Frameworks::Rails::Environment::ApplicationController
/Library/Ruby/Gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:442:in `load_missing_constant'
/Library/Ruby/Gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:77:in `const_missing'
/Library/Ruby/Gems/1.8/gems/lockdown-1.6.2/lib/lockdown/frameworks/rails.rb:70:in `controller_parent'
/Library/Ruby/Gems/1.8/gems/lockdown-1.6.2/lib/lockdown/frameworks/rails.rb:29:in `mixin_controller'
/Library/Ruby/Gems/1.8/gems/lockdown-1.6.2/lib/lockdown/frameworks/rails.rb:18:in `mixin'
/Library/Ruby/Gems/1.8/gems/lockdown-1.6.2/lib/lockdown/frameworks/rails.rb:14:in `included'
/Library/Ruby/Gems/1.8/gems/lockdown-1.6.2/lib/lockdown.rb:72:in `include'
/Library/Ruby/Gems/1.8/gems/lockdown-1.6.2/lib/lockdown.rb:72:in `mixin_resource?'
/Library/Ruby/Gems/1.8/gems/lockdown-1.6.2/lib/lockdown.rb:67:in `each'
/Library/Ruby/Gems/1.8/gems/lockdown-1.6.2/lib/lockdown.rb:67:in `mixin_resource?'
/Library/Ruby/Gems/1.8/gems/lockdown-1.6.2/lib/lockdown.rb:43:in `mixin'
/Library/Ruby/Gems/1.8/gems/lockdown-1.6.2/lib/lockdown.rb:85
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require'
/Library/Ruby/Gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:155:in `require'
/Users/steven/Drominay/config/initializers/lockit.rb:1
/Library/Ruby/Gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:144:in `load_without_new_constant_marking'
/Library/Ruby/Gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:144:in `load'
/Users/steven/.gem/ruby/1.8/gems/rails-2.2.2/lib/initializer.rb:550:in `load_application_initializers'
/Users/steven/.gem/ruby/1.8/gems/rails-2.2.2/lib/initializer.rb:549:in `each'
/Users/steven/.gem/ruby/1.8/gems/rails-2.2.2/lib/initializer.rb:549:in `load_application_initializers'
/Users/steven/.gem/ruby/1.8/gems/rails-2.2.2/lib/initializer.rb:167:in `process'
/Users/steven/.gem/ruby/1.8/gems/rails-2.2.2/lib/initializer.rb:112:in `send'
/Users/steven/.gem/ruby/1.8/gems/rails-2.2.2/lib/initializer.rb:112:in `run'
/Users/steven/Drominay/config/environment.rb:14
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require'
/Library/Ruby/Gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:153:in `require'
/Library/Ruby/Gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:521:in `new_constants_in'
/Library/Ruby/Gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:153:in `require'
/Users/steven/.gem/ruby/1.8/gems/rails-2.2.2/lib/tasks/misc.rake:3
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `call'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `execute'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `each'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:597:in `invoke_with_call_chain'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:607:in `invoke_prerequisites'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:604:in `each'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:604:in `invoke_prerequisites'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:596:in `invoke_with_call_chain'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `each'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2001:in `run'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/bin/rake:31
/usr/bin/rake:19:in `load'
/usr/bin/rake:19

1 个答案:

答案 0 :(得分:0)

根据this article将application.rb更改为application_controller.rb修复了此问题。

(但仍然对如何实际使用此痕迹感兴趣。)