Fabrication::MisplacedFabricateError while using Fabrication Gem on Rails 2.3.16 <p>I am using Fabrication gem v-2.5.0 on Rails 2.3.16 but get the following errors when I run the unit test cases:</p> <p>Below is the code snippet :</p> <blockquote> <p><strong>First case</strong></p> </blockquote> <pre><code>Fabricate(:some_modal) Fabrication::MisplacedFabricateError: # from /Users/user_xyz/.rvm/gems/ree-1.8.7- 2011.03@project/gems/fabrication-2.5.0/lib/fabrication.rb:51:in `Fabricate' from (irb):3 </code></pre> <blockquote> <p><strong>Second case</strong></p> </blockquote> <pre><code>Fabricate(:some_other_modal) SyntaxError: /Users/user_xyz/.rvm/gems/ree-1.8.7-2011.03@project/gems/fabrication-2.5.0/lib/fabrication/generator/active_record.rb:8: syntax error, unexpected ':', expecting ')' ...ttributes, without_protection: true) </code></pre> <p>Can someone please help me resolve these.<br/></p> <blockquote> <p><strong>Modal Class :</strong><br/></p> </blockquote> <pre><code> class ErrorCode attr_accessor :mappings has_many :error_code_mappings end </code></pre> <blockquote> <p><strong>Fabricator :</strong><br/></p> </blockquote> <pre><code>Fabricator(:error_code) do application_id 77 error_code_mappings(:count =&gt; 3) { |error_code, i| Fabricate.build(:error_code_mapping, :error_code =&gt; Fabricate.build(:error_code, :code =&gt; error_code.code + i))} end </code></pre> <blockquote> <p><strong>Unit test file:</strong><br/></p> </blockquote> <pre><code>require 'test_helper' class ErrorCodeTest &lt; ActiveSupport::TestCase context "ErrorCode" do setup do @error_code = Fabricate.build(:error_code) assert(@error_code.valid?) end should "have setter for mapping attribute" do assert_respond_to(@error_code, :mappings=) end end </code></pre>