Are you requiring spec/factories.rb by hand? factory_girl generally
does that automatically, and if you somehow load the file twice, it
will try to define the same factories twice.
This could be related to Ruby 1.8, because 1.8 will load the same file
twice if you require it with different path names (like ../
factories.rb instead of RAILS_ROOT/factories.rb).
-Joe
On May 6, 12:51 pm, Ian Vaughan <ianrvaug...@gmail.com> wrote:
> Get the following error :-
> $ rake
> (in /home/ian/tests/buzz)
> /usr/local/lib/ruby/gems/1.8/gems/factory_girl-1.2.4/lib/factory_girl/
> factory.rb:59:in `define': Factory already defined: page
> (Factory::DuplicateDefinitionError)
> from /home/ian/tests/buzz/spec/factories.rb:5
> from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:
> 31:in `gem_original_require'
> from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:
> 31:in `require'
> from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/
> active_support/dependencies.rb:158:in `require'
> from /home/ian/tests/buzz/spec/spec_helper.rb:17
> from /home/ian/tests/buzz/spec/lib/history_spec.rb:1:in `require'
> from /home/ian/tests/buzz/spec/lib/history_spec.rb:1
> from /usr/local/lib/ruby/gems/1.8/gems/rspec-1.3.0/lib/spec/runner/
> example_group_runner.rb:15:in `load'
> from /usr/local/lib/ruby/gems/1.8/gems/rspec-1.3.0/lib/spec/runner/
> example_group_runner.rb:15:in `load_files'
> from /usr/local/lib/ruby/gems/1.8/gems/rspec-1.3.0/lib/spec/runner/
> example_group_runner.rb:14:in `each'
> from /usr/local/lib/ruby/gems/1.8/gems/rspec-1.3.0/lib/spec/runner/
> example_group_runner.rb:14:in `load_files'
> from /usr/local/lib/ruby/gems/1.8/gems/rspec-1.3.0/lib/spec/runner/
> options.rb:133:in `run_examples'
> from /usr/local/lib/ruby/gems/1.8/gems/rspec-1.3.0/lib/spec/runner/
> command_line.rb:9:in `run'
> from /usr/local/lib/ruby/gems/1.8/gems/rspec-1.3.0/bin/spec:5
> rake aborted!
> Command /usr/local/bin/ruby -I"lib" "/usr/local/lib/ruby/gems/1.8/
> gems/rspec-1.3.0/bin/spec" "spec/lib/history_spec.rb" "spec/lib/
> content_formatter_spec.rb" "spec/controllers/pages_controller_spec.rb"
> "spec/models/page_spec.rb" "spec/views/pages/show.html.haml_spec.rb"
> "spec/views/pages/edit.html.haml_spec.rb" "spec/views/pages/
> index.html.haml_spec.rb" "spec/views/layouts/
> application.html.haml_spec.rb" --options "/home/ian/tests/buzz/spec/
> spec.opts" failed
> (See full trace by running task with --trace)
> $ ruby -v
> ruby 1.8.8dev (2010-05-05) [i686-linux]
> $ gem -v
> 1.3.5
> $ rails -v
> Rails 2.3.5
> It was working ok, before I thought it a good idea to do a system
> reinstall.
> I think I was using ruby1.9.1, if that would make any diff?
> --
> Individuals over processes. Interactions over tools. Agile Rails training from thoughtbot, the makers of Clearance, Shoulda, & Factory Girl:http://thoughtbot.com/services/training
> You received this message because you are subscribed to the "factory_girl" mailing list.
> To post to this group, send email to factory_girl@googlegroups.com
> To unsubscribe from this group, send email to
> factory_girl+unsubscribe@googlegroups.com
> For more options, visit this group athttp://groups.google.com/group/factory_girl?hl=en
--
Individuals over processes. Interactions over tools. Agile Rails training from thoughtbot, the makers of Clearance, Shoulda, & Factory Girl:
http://thoughtbot.com/services/training
You received this message because you are subscribed to the "factory_girl" mailing list.
To post to this group, send email to factory_girl@googlegroups.com
To unsubscribe from this group, send email to
factory_girl+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/factory_girl?hl=en