title: Failing to run RSpec (uninitialized constant User (NameError)
body: <p>Trying to run bundle exec rspec spec/models/user_spec.rb but failing to execute (see error below).</p>
  
  <p>Contents of user_spec.rb:</p>
  
  <pre><code>require 'rails_helper'
  
  describe User do
    pending "add some examples to (or delete) #{__FILE__}"
  end
  </code></pre>
  
  <p>If I remove the last 3 lines, then it complete with 0 examples and 0 failures. However, when the last 3 lines are present, it generates an error</p>
  
  <pre><code>/spec/models/user_spec.rb:4:in `&lt;top (required)&gt;': uninitialized constant User (NameError)
      from /var/lib/gems/1.9.1/gems/rspec-core-3.0.3/lib/rspec/core/configuration.rb:1057:in `load'
      from /var/lib/gems/1.9.1/gems/rspec-core-3.0.3/lib/rspec/core/configuration.rb:1057:in `block in load_spec_files'
      from /var/lib/gems/1.9.1/gems/rspec-core-3.0.3/lib/rspec/core/configuration.rb:1057:in `each'
      from /var/lib/gems/1.9.1/gems/rspec-core-3.0.3/lib/rspec/core/configuration.rb:1057:in `load_spec_files'
      from /var/lib/gems/1.9.1/gems/rspec-core-3.0.3/lib/rspec/core/runner.rb:97:in `setup'
      from /var/lib/gems/1.9.1/gems/rspec-core-3.0.3/lib/rspec/core/runner.rb:85:in `run'
      from /var/lib/gems/1.9.1/gems/rspec-core-3.0.3/lib/rspec/core/runner.rb:70:in `run'
      from /var/lib/gems/1.9.1/gems/rspec-core-3.0.3/lib/rspec/core/runner.rb:38:in `invoke'
      from /var/lib/gems/1.9.1/gems/rspec-core-3.0.3/exe/rspec:4:in `&lt;top (required)&gt;'
      from /usr/local/bin/rspec:23:in `load'
      from /usr/local/bin/rspec:23:in `&lt;main&gt;'
  </code></pre>
  
  <p>It seems it doesn't know what User is and treats it as a constant, when this is infact a model. I have verified in the ruby sandbox that I can create new Users in the database. Any ideas?</p>
  
  <hr>
  
  <p>Answer:
  After removing --warnings from .rspec (thank you kirti), current error was about capybara version being too low (requires 2.2). After installing the latest version (modifying gemfile and bundle install), rspec appears to be executing correctly. Thank you to all for your comments.</p>