Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
rake command fails with "Factory already defined"
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Ian Vaughan  
View profile  
 More options May 6 2010, 12:51 pm
From: Ian Vaughan <ianrvaug...@gmail.com>
Date: Thu, 6 May 2010 09:51:07 -0700 (PDT)
Local: Thurs, May 6 2010 12:51 pm
Subject: [factory_girl] rake command fails with "Factory already defined"
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 at
http://groups.google.com/group/factory_girl?hl=en


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Joe Ferris  
View profile  
 More options May 7 2010, 12:22 pm
From: Joe Ferris <joe.r.fer...@gmail.com>
Date: Fri, 7 May 2010 09:22:40 -0700 (PDT)
Local: Fri, May 7 2010 12:22 pm
Subject: [factory_girl] Re: rake command fails with "Factory already defined"
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:

--
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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Yvan Ross  
View profile  
 More options Nov 11 2012, 11:56 am
From: Yvan Ross <yvan.r...@gmail.com>
Date: Sun, 11 Nov 2012 08:56:26 -0800 (PST)
Local: Sun, Nov 11 2012 11:56 am
Subject: Re: [factory_girl] rake command fails with "Factory already defined"

I have similar problem..
I was using factory_girl_rails gem but  factory_girl gem was still there. I
remove it and it worked.

Le jeudi 6 mai 2010 12:51:07 UTC-4, Ian Vaughan a écrit :


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »