0

I would like to require a file called "factories.rb":

require File.join(File.dirname(__FILE__), 'factories.rb' )

and am getting this error:

/home/sean/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems
/custom_require.rb:36:in `require': cannot load such file -- /home/sean/rand/test/factories.rb (LoadError)

I have ruby-1.9.3-p194 installed. Why does it also say 1.9.1 in the error message?

the Tin Man
  • 158,662
  • 42
  • 215
  • 303
chief
  • 730
  • 1
  • 9
  • 19

1 Answers1

1

Usually, Factory Girl automatically loads the factories.rb file ( and yours is in the right place ).

I often have problems with that require syntax ( it's mostly likely just me ), might try this:

require File.dirname(__FILE__) + '/factories' # it's okay to leave off the .rb

Also, the folder is 1.9.1 just 'cause the ruby core team decided to keep the name 1.9.1 throughout the 1.9 release schedule. I'll try and find a link.

EDIT: Here's a link to a previous discussion on SO about the folder being 1.9.1: 1st answer is good.

Community
  • 1
  • 1
jerom3
  • 26
  • 4