Please forgive any shortcomings in this (my first-ever) post on StackOverflow. I\'m brand new to Ruby on Rails. I\'m following the Rails Tutorial. I have spent many unsucces
Remove redundant require 'spec_helper'
line from your spec_helper.rb
file.
In your spec_helper.rb
, you have the following line twice:
Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
Delete the first instance (the one on line 2). This is what is causing the error.
Having this line before require 'rspec/rails'
will cause problems because we don't know what Rails
is, and so we cannot call the root
method.
The second instance (on line 13) is fine because this is after require 'rspec/rails'
.