The following is the error message running rspec spec:
/factory_girl-2.1.0/lib/factory_girl/registry.rb:38:in `add_as': Already defined: user (FactoryGirl::DuplicateDefinitionError)
There are both factory_girl (2.1.0) and factory_girl_rails (1.2.0) installed. This error message disappears if factory_girl 2.1.0 is removed (caused another error of undefined method though). However the same setup has no problem running on another laptop with rspec.
Here is part of the output of bundle show command.
- cucumber (1.0.2)
- cucumber-rails (1.0.2)
- database_cleaner (0.6.7)
- diff-lcs (1.1.2)
- erubis (2.7.0)
- execjs (1.2.4)
- factory_girl (2.1.0)
- factory_girl_rails (1.2.0)
- ffi (1.0.9)
- gherkin (2.4.5)
- hike (1.2.1)
- i18n (0.6.0)
- jquery-rails (1.0.13)
- json (1.5.3)
- json_pure (1.5.3)
- mail (2.3.0)
- mime-types (1.16)
- multi_json (1.0.3)
- nokogiri (1.5.0)
- polyglot (0.3.2)
- rack (1.3.2)
- rack-cache (1.0.3)
- rack-mount (0.8.3)
- rack-ssl (1.3.2)
- rack-test (0.6.1)
- rails (3.1.0)
- railties (3.1.0)
- rake (0.9.2)
- rdoc (3.9.4)
- rspec (2.6.0)
- rspec-core (2.6.4)
- rspec-expectations (2.6.0)
- rspec-mocks (2.6.0)
- rspec-rails (2.6.1)
- rubyzip (0.9.4)
- sass (3.1.7)
- sass-rails (3.1.0.rc.6)
- selenium-webdriver (2.4.0)
- simple_form (1.4.2)
Here is part of gemfile for the factory_girl and rspec.
group :test do
# Pretty printed test output
gem "rspec-rails", ">= 2.0.0"
gem "cucumber-rails", ">=0.3.2"
gem 'webrat', ">= 0.7.2"
gem 'factory_girl_rails'
gem 'turn', :require => false
end
Any thoughts? Thanks.