Working with rails console

I am using rvm on the ubuntu. I am following the rails tutorial from
Lynda.com
I was on the section of working in the rails console when i got the
following errors :-

I gave the command rails console

nitin@nitin-vaio:~/Nitin/Sites/app$ rails console

Loading development environment (Rails 3.2.1)

1.9.2p290 :001 > subject=Subject.new
=> #<Subject id: nil, subject_name: nil, position: nil, visible: false,
created_at: nil, updated_at: nil>

1.9.2p290 :002 > subject.new_record?
=> true

1.9.2p290 :003 > subject.name = "History"
NoMethodError: undefined method `name=' for #<Subject:0x8ab6e9c>
  from
/home/nitin/Nitin/Sites/app/mysql2/ruby/1.9.1/gems/activemodel-3.2.1/lib/active_model/attribute_methods.rb:407:in
`method_missing'
  from
/home/nitin/Nitin/Sites/app/mysql2/ruby/1.9.1/gems/activerecord-3.2.1/lib/active_record/attribute_methods.rb:126:in
`method_missing'
  from (irb):3
  from
/home/nitin/Nitin/Sites/app/mysql2/ruby/1.9.1/gems/railties-3.2.1/lib/rails/commands/console.rb:47:in
`start'
  from
/home/nitin/Nitin/Sites/app/mysql2/ruby/1.9.1/gems/railties-3.2.1/lib/rails/commands/console.rb:8:in
`start'
  from
/home/nitin/Nitin/Sites/app/mysql2/ruby/1.9.1/gems/railties-3.2.1/lib/rails/commands.rb:41:in
`<top (required)>'
  from script/rails:6:in `require'
  from script/rails:6:in `<main>'
1.9.2p290 :004 > subject.name = "History"
NoMethodError: undefined method `name=' for #<Subject:0x8ab6e9c>
  from
/home/nitin/Nitin/Sites/app/mysql2/ruby/1.9.1/gems/activemodel-3.2.1/lib/active_model/attribute_methods.rb:407:in
`method_missing'
  from
/home/nitin/Nitin/Sites/app/mysql2/ruby/1.9.1/gems/activerecord-3.2.1/lib/active_record/attribute_methods.rb:126:in
`method_missing'
  from (irb):4
  from
/home/nitin/Nitin/Sites/app/mysql2/ruby/1.9.1/gems/railties-3.2.1/lib/rails/commands/console.rb:47:in
`start'
  from
/home/nitin/Nitin/Sites/app/mysql2/ruby/1.9.1/gems/railties-3.2.1/lib/rails/commands/console.rb:8:in
`start'
  from
/home/nitin/Nitin/Sites/app/mysql2/ruby/1.9.1/gems/railties-3.2.1/lib/rails/commands.rb:41:in
`<top (required)>'
  from script/rails:6:in `require'
  from script/rails:6:in `<main>'

When I tried to create a subject name I got the above errors.
I couldn't find the solution on google. Please help me if anyone has
encountered such an error and solved it.

Attachments:
http://www.ruby-forum.com/attachment/7053/Screenshot_at_2012-02-13_14_11_38.png

I am using rvm on the ubuntu. I am following the rails tutorial from

Lynda.com

I was on the section of working in the rails console when i got the

following errors :-

I gave the command rails console

nitin@nitin-vaio:~/Nitin/Sites/app$ rails console

Loading development environment (Rails 3.2.1)

1.9.2p290 :001 > subject=Subject.new

=> #<Subject id: nil, subject_name: nil, position: nil, visible: false,

created_at: nil, updated_at: nil>

Your variable name is “subject_name”

1.9.2p290 :002 > subject.new_record?

=> true

1.9.2p290 :003 > subject.name = “History”

NoMethodError: undefined method `name=’ for #Subject:0x8ab6e9c

from

Here, you want to use a variable with name “name”.

Could you try:

subject.subject_name = “History”

You could also change the name of the column with a migration.

HTH,

Peter