ulimit -s 3276 http://johnwilger.com/2007/11/accessing-original-scope-from-ruby.htmlsays that “when you run define_method you can accidentally create infinite loops”–which this one is doing, as you can see
exceptionstack level too deepSystemStackError: stack level too deep from /opt/local/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/base.rb:1983:in `==' from /opt/local/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/base.rb:1983:in `===' from /opt/local/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/base.rb:1983:in `convert_number_column_value' from /opt/local/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/base.rb:1973:in `write_attribute' from /opt/local/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/attribute_methods.rb:67:in `attribute=' from /opt/local/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/base.rb:1855:in `__send__' from /opt/local/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/base.rb:1855:in `method_missing' from /opt/local/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/base.rb:1672:in `send' from /opt/local/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/base.rb:1672:in `attributes=' from /opt/local/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/base.rb:1671:in `each' from /opt/local/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/base.rb:1671:in `attributes=' from /opt/local/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/base.rb:1505:in `initialize_without_callbacks' from /opt/local/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/callbacks.rb:225:in `initialize' from /opt/local/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/base.rb:449:in `new' from /opt/local/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/base.rb:449:in `create' from ./db/add_single_zips.rb:3918 from ./db/add_single_zips.rb:3908:in `each_line' from ./db/add_single_zips.rb:3908 from ./db/add_single_zips.rb:3888:in `each_line' from ./db/add_single_zips.rb:3888 from /opt/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:493:in `load' from /opt/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:493:in `load' from /opt/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:345:in `new_constants_in' from /opt/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:493:in `load' from (irb):9>> exit
So an easy way around it is to make sure those methods are defined already (like attributes=). Make a normal one. Save it. Maybe?
still haven’t figured it out. Increase stack, maybe?
>> Fixnum.class_eval(“def to_str; to_s; end”)
=> nil
>> 9 == ”
SystemStackError: stack level too deep
from (irb):2:in `==’
from (irb):2
>>
was the culprit. Don’t redefine that!!