0

「factories.rb」というファイルが必要です:

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

そして、このエラーが発生しています:

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

ruby-1.9.3-p194 をインストールしました。エラー メッセージに 1.9.1 と表示されるのはなぜですか?

4

1 に答える 1

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.

于 2012-05-06T00:16:38.303 に答える