刚刚通过RVM Ruby 2.0.0和Rails 4.0.0安装。开始一个新项目,当试图添加gem'stage-girl-rails',并运行bundle install时,我收到了这个错误:
Fetching gem metadata from https://rubygems.org/.........
Fetching gem metadata from https://rubygems.org/..
Resolving dependencies...
Could not find gem 'factory-girl-rails (~> 4.2.1) ruby' in the gems available on this machine.
有什么想法会发生这种情况吗?
答案 0 :(得分:10)
您需要将这些短划线更改为下划线:
gem 'factory_girl_rails', '4.2.1'
答案 1 :(得分:-2)
factory_girl_rails似乎不适用于版本高于3.2.11的rails https://github.com/thoughtbot/factory_girl_rails#rails