0

I have a ActiveRecord::Base subclass. When I create a new instance I'm getting an argument error:

ArgumentError:
       wrong number of arguments (2 for 1)

Here is my code:

class Subclass < ActiveRecord::Base

end

Subclass.new(hash, without_protection: true)

Gem versions are:

activemodel (3.2.13)
activerecord (3.2.13)

Why does this generate and argument error? According to API Dock, inititialize still takes two arguments as of 3.2.13

Undistraction
  • 42,754
  • 56
  • 195
  • 331

1 Answers1

0

Looks like RubyGems is using the incorrect version of ActiveModel. From the error:

/Users/me/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/activerecord-4.0.0/lib/active_record/core.rb:180:in `initialize': wrong number of arguments (2 for 1) (ArgumentError)

No idea why, so posted another question (here)[Rubygems Loading Wrong Version of Gem

Undistraction
  • 42,754
  • 56
  • 195
  • 331