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?
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:
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.