title: uninitialized constant FactoryGirl when run rspec, but works in console
body: <p>This is kind of my first time using rspec. I am getting <code>uninitialized constant FactoryGirl</code> when running <code>rspec</code>. I tried in in the console by running, <code>rails c test</code>, and it recognizes FactoryGirl properly.</p>
  
  <p>Here is the output from rspec:</p>
  
  <pre><code>Failures:
  
    1) basic API gives authentication token from username and password
       Failure/Error: user = FactoryGirl.create(:user, last_name: last_name)
       NameError:
         uninitialized constant FactoryGirl
       # ./spec/requests/api/v1/api_spec.rb:4:in `block (2 levels) in &lt;top (required)&gt;'
  
  Finished in 0.00069 seconds
  1 example, 1 failure
  
  Failed examples:
  
  rspec ./spec/requests/api/v1/api_spec.rb:2 # basic API gives authentication token from username and password
  </code></pre>
  
  <p>And this is my spec/spec_helper.rb:</p>
  
  <pre><code># This file is copied to spec/ when you run 'rails generate rspec:install'
  ENV["RAILS_ENV"] ||= 'test'
  require File.expand_path("../../config/environment", __FILE__)
  require 'rspec/rails'
  require 'rspec/autorun'
  
  require 'factory_girl_rails'
  FactoryGirl.find_definitions
  
  Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }
  
  
  ActiveRecord::Migration.check_pending! if defined?(ActiveRecord::Migration)
  
  RSpec.configure do |config|
    config.fixture_path = "#{::Rails.root}/spec/fixtures"
  
    config.use_transactional_fixtures = true
  
    config.infer_base_class_for_anonymous_controllers = false
  
    config.order = "random"
  
  end
  </code></pre>
  
  <p>I am not quite sure where to <code>require 'factory_girl_rails</code> and <code>FactoryGirl.find_definitions</code> because in the guide it just said "all you'll need to do is run <code>FactoryGirl.find_definitions</code> "</p>