I created a scaffold in Rails 3 and ran the migration. But when I tried to use the rails console to create an instance of the model, it doesn't work. I repeated the same process in Rails 4 and it works perfectly. Here is the commands I typed in.
rails new testApp rails g scaffold Test name:string rake db:migrate rails console p = Test.new
and below is the response I got:
1.9.3p194 :002 > p = Test.new
NoMethodError: undefined method new' for Test:Module
from (irb):2
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.15/lib/rails/commands/console.rb:47:in
start'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.15/lib/rails/commands/console.rb:8:in start'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.15/lib/rails/commands.rb:41:in
'
from script/rails:6:in require'
from script/rails:6:in
'
Please help. I am a beginner in rails. Thank you.