2012-10-11 2 views
0

저는 Mac osx Lion 환경에서 Rails 2.3.8 앱을 Rails 3.0.17로 업그레이드하고 RVM (Ruby 1.9.3)을 사용하고 있습니다. (이미 bundler 사용).레일 3 콘솔 올리기 오류

User.first 
NoMethodError: You have a nil object when you didn't expect it! 
You might have expected an instance of Array. 
The error occurred while evaluating nil.[] 
    from /Users/franklin/rails_apps/myapp/app/models/user.rb:84:in `<class:User>' 
    from /Users/franklin/rails_apps/myapp/app/models/user.rb:1:in `<top (required)>' 
    from /Users/franklin/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.0.17/lib/active_support/dependencies.rb:458:in `load' 
    from /Users/franklin/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.0.17/lib/active_support/dependencies.rb:458:in `block in load_file' 
    from /Users/franklin/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.0.17/lib/active_support/dependencies.rb:597:in `new_constants_in' 
    from /Users/franklin/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.0.17/lib/active_support/dependencies.rb:457:in `load_file' 
    from /Users/franklin/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.0.17/lib/active_support/dependencies.rb:344:in `require_or_load' 
    from /Users/franklin/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.0.17/lib/active_support/dependencies.rb:491:in `load_missing_constant' 
    from /Users/franklin/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.0.17/lib/active_support/dependencies.rb:183:in `block in const_missing' 
    from /Users/franklin/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.0.17/lib/active_support/dependencies.rb:181:in `each' 
    from /Users/franklin/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.0.17/lib/active_support/dependencies.rb:181:in `const_missing' 
    from (irb):7 
    from /Users/franklin/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.17/lib/rails/commands/console.rb:44:in `start' 
    from /Users/franklin/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.17/lib/rails/commands/console.rb:8:in `start' 
    from /Users/franklin/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.17/lib/rails/commands.rb:23:in `<top (required)>' 
    from script/rails:6:in `require' 
    from script/rails:6:in `<main>' 

도와주세요 (모든 DB 호출에) :

내 애플 OK 노력하고 있지만, 레일 콘솔은 나에게 오류를주고있다.

+0

stack trace는 user.rb의 84 행에 문제가 있음을 분명히 말합니다. – UncleGene

+0

몇 가지 모델에서만 발생합니다. – Valadares

+0

감사 UncleGene. 나는이 업그레이 드가 나를위한 번거 로움에 시달렸다. – Valadares

답변

0

사용자 모델에서 Paperclip configs를 수정하면 모든 것이 잘 동작합니다. 조언 해 주셔서 감사드립니다.