railstutorial.org - undefined method `Factory'

前端 未结 10 1426
时光取名叫无心
时光取名叫无心 2021-02-14 08:06

I\'m attempting to follow railstutorial.org, and am currently on Chapter 7, where you start using factories: http://railstutorial.org/chapters/modeling-and-viewing-users-two#sec

10条回答
  •  死守一世寂寞
    2021-02-14 08:22

    I was determined to use the newest version of Factory Girl, so I tried to adapt the code. Didn't work for me, so I used

    gem 'factory_girl_rails', '1.0'
    

    in the Gemfile to lock the version at 1.0

    bundle update
    

    restart spork and autotest and it worked.

提交回复
热议问题