2012-03-02 11 views
1

を投げ、私は以下の例を貼り付けましたが、にto_xmlを呼び出すと、すべてのモデルは、このエラーがスローされます。私はすべてを試しましたが、私はそれが以前に見たことのあるものです。それは誰のためにどんな鐘を鳴らしますか?to_xmlはいつも私はRailsの3.1</p> <p>によエラー

1.8.7 :004 > Person.first.to_xml 
    Person Load (2.0ms) SELECT `people`.* FROM `people` LIMIT 1 
ArgumentError: wrong number of arguments (1 for 0) 
    from /home/khughes/.rvm/gems/[email protected]/gems/builder-3.0.0/lib/builder/xmlbase.rb:135:in `to_xs' 
    from /home/khughes/.rvm/gems/[email protected]/gems/builder-3.0.0/lib/builder/xmlbase.rb:135:in `_escape' 
    from /home/khughes/.rvm/gems/[email protected]/gems/builder-3.0.0/lib/builder/xmlbase.rb:140:in `_escape_quote' 
    from /home/khughes/.rvm/gems/[email protected]/gems/builder-3.0.0/lib/builder/xmlmarkup.rb:320:in `_attr_value' 
    from /home/khughes/.rvm/gems/[email protected]/gems/builder-3.0.0/lib/builder/xmlmarkup.rb:308:in `_insert_attributes' 
    from /home/khughes/.rvm/gems/[email protected]/gems/builder-3.0.0/lib/builder/xmlmarkup.rb:306:in `each' 
    from /home/khughes/.rvm/gems/[email protected]/gems/builder-3.0.0/lib/builder/xmlmarkup.rb:306:in `_insert_attributes' 
    from /home/khughes/.rvm/gems/[email protected]/gems/builder-3.0.0/lib/builder/xmlmarkup.rb:284:in `_special' 
    from /home/khughes/.rvm/gems/[email protected]/gems/builder-3.0.0/lib/builder/xmlmarkup.rb:250:in `instruct!' 
    from /home/khughes/.rvm/gems/[email protected]/gems/activemodel-3.1.1/lib/active_model/serializers/xml.rb:93:in `serialize' 
    from /home/khughes/.rvm/gems/[email protected]/gems/activerecord-3.1.1/lib/active_record/serializers/xml_serializer.rb:175:in `to_xml' 
    from (irb):4 

答えて

1

は、いくつかの時間前に同じ問題を持っていた、あなたはプロジェクトにバンドルされた宝石をhpricotしているのですか? https://github.com/hpricot/hpricot/issues/53smeevilの記事を参照してください)

+0

を、それがあったことを:もしそうなら、to_xmlは

を動作するかどうか私のために働いた解決策があると、Gemfileから削除bundleを実行して、チェックしてみてください!ありがとう、私はそれを追跡したとは思わない。 –

関連する問題