我在rails 3.2.8 中的新项目中使用Factory_girl_rails。我收到上述错误。谁能建议我该怎么做。
/home/sandhya/.rvm/gems/ruby-1.9.3-p0@robly/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251:in `require': cannot load such file -- /home/sandhya/robly/spec/factories (LoadError)
from /home/sandhya/.rvm/gems/ruby-1.9.3-p0@robly/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251:in `block in require'
from /home/sandhya/.rvm/gems/ruby-1.9.3-p0@robly/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:236:in `load_dependency'
from /home/sandhya/.rvm/gems/ruby-1.9.3-p0@robly/gems/activesupport-3.2.8/lib/active_support/dependencies.rb:251:in `require'
from /home/sandhya/robly/spec/spec_helper.rb:6:in `<top (required)>'
from /home/sandhya/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /home/sandhya/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /home/sandhya/robly/spec/models/address_spec.rb:1:in `<top (required)>'
from /home/sandhya/.rvm/gems/ruby-1.9.3-p0@robly/gems/rspec-core-2.11.1/lib/rspec/core/configuration.rb:780:in `load'
from /home/sandhya/.rvm/gems/ruby-1.9.3-p0@robly/gems/rspec-core-2.11.1/lib/rspec/core/configuration.rb:780:in `block in load_spec_files'
from /home/sandhya/.rvm/gems/ruby-1.9.3-p0@robly/gems/rspec-core-2.11.1/lib/rspec/core/configuration.rb:780:in `map'
from /home/sandhya/.rvm/gems/ruby-1.9.3-p0@robly/gems/rspec-core-2.11.1/lib/rspec/core/configuration.rb:780:in `load_spec_files'
from /home/sandhya/.rvm/gems/ruby-1.9.3-p0@robly/gems/rspec-core-2.11.1/lib/rspec/core/command_line.rb:22:in `run'
from /home/sandhya/.rvm/gems/ruby-1.9.3-p0@robly/gems/rspec-core-2.11.1/lib/rspec/core/runner.rb:69:in `run'
from /home/sandhya/.rvm/gems/ruby-1.9.3-p0@robly/gems/rspec-core-2.11.1/lib/rspec/core/runner.rb:8:in `block in autorun'
我的 gemfile 是这样的:
团体 :
test do
gem 'rspec-rails'
gem "factory_girl_rails"
gem "capybara"
end
在我的 factory.rb 我有
FactoryGirl.define do
factory :address do |v|
v.email "test@email.com"
v.state "Karnataka"
v.country "India"
v.zip_code "560061"
v.office_mobiel "9999999999"
v.company "Some Company"
v.city "Bangalore"
end
end