Hello! I'm very new to ruby and ruby on rails. I'm following a tutorial found here: www.javapassion.com/handsonlabs/rails_activerecord/ I'm running NetBeans as an IDE, with jruby, rails and MySQL.
Here is the basic rundown of what I have done 1) Created db via Rake 2) Created table with 3 columns via Migration (user name:string hobby:string age:integer) 3) Inserted 3 user records via Rails Console 4) Added additional column via Migration (AddEmailField email:string) (Inside the migration rb -> "add_column :users, :email, :string" 5) This is where things go poorly, I try to add a new user with the email but get an error. Here is what I enter via Rails Console user = User.new(:name => "TommyJones", :hobby => "tennis", :age => 138, :email => "[email protected]") And I get the following error: -------------------------------------------------------------- NoMethodError: undefined method `email=' for #<User:0x751932> from C:/Program Files/NetBeans 6.5 RC2/ruby2/jruby-1.1.4/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/attribute_methods.rb:251:in `method_missing' from C:/Program Files/NetBeans 6.5 RC2/ruby2/jruby-1.1.4/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/base.rb:2361:in `attributes=' from C:/Program Files/NetBeans 6.5 RC2/ruby2/jruby-1.1.4/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/base.rb:2360:in `each' from C:/Program Files/NetBeans 6.5 RC2/ruby2/jruby-1.1.4/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/base.rb:2360:in `attributes=' from C:/Program Files/NetBeans 6.5 RC2/ruby2/jruby-1.1.4/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/base.rb:2130:in `initialize' from (irb):23:in `binding' from C:/Program Files/NetBeans 6.5 RC2/ruby2/jruby-1.1.4/lib/ruby/1.8/irb.rb:150:in `eval_input' from C:/Program Files/NetBeans 6.5 RC2/ruby2/jruby-1.1.4/lib/ruby/1.8/irb.rb:259:in `signal_status' from C:/Program Files/NetBeans 6.5 RC2/ruby2/jruby-1.1.4/lib/ruby/1.8/irb.rb:147:in `eval_input' from C:/Program Files/NetBeans 6.5 RC2/ruby2/jruby-1.1.4/lib/ruby/1.8/irb.rb:146:in `eval_input' from C:/Program Files/NetBeans 6.5 RC2/ruby2/jruby-1.1.4/lib/ruby/1.8/irb.rb:70:in `start' from C:/Program Files/NetBeans 6.5 RC2/ruby2/jruby-1.1.4/lib/ruby/1.8/irb.rb:69:in `catch' from C:/Program Files/NetBeans 6.5 RC2/ruby2/jruby-1.1.4/lib/ruby/1.8/irb.rb:69:in `start' from C:/Program Files/NetBeans 6.5 RC2/ruby2/jruby-1.1.4\bin\jirb:19 ------------------------------------------------------------- Being so new to this I cannot figure out why it won't allow me to enter a user using all the fields? If I do the same entry without the email information to insert it still works. Thanks in advance! -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---

