0

I have Produtor model on my app and I'm trying to debug it with rails console..

but when I try to use rails console inside my app directory I get this error

D:\ruby\app>rails console
Loading development environment (Rails 3.2.9)
irb(main):001:0> Produtors.all
NameError: uninitialized constant Produtors
        from (irb):1
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.9/lib/rails/commands/console.rb:47:in `start'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.9/lib/rails/commands/console.rb:8:in `start'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.9/lib/rails/commands.rb:41:in `<top (required)>'
        from script/rails:6:in `require'
        from script/rails:6:in `<main>'

what is the problem?

1 Answer 1

5

You need to use the name of the model, Produtor instead. The extra s is what is throwing you off. Try Produtor.all instead.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.