Reputation: 1463
I am getting the error message:
'cannot load such file -- spec_helper'
after updating the rspec gem from 2.13 to 2.14.1.
Below is a copy of my gem list. Does rspec 2.14.1 have some dependencies, gems that I need to update?
*** LOCAL GEMS ***
active_support (3.0.0)
activesupport (4.0.0)
addressable (2.3.4)
atomic (1.1.13)
bigdecimal (1.1.0)
builder (3.2.2)
bundler (1.3.5)
bundler-unload (1.0.1)
capybara (2.1.0, 1.1.4)
capybara-screenshot (0.3.14)
capybara-webkit (1.0.0)
childprocess (0.3.9)
chronic (0.9.1)
cliver (0.2.1)
coffee-script (2.2.0)
coffee-script-source (1.6.3, 1.6.2)
cucumber (1.3.2, 1.1.4)
data_magic (0.14)
dbi (0.4.5)
deprecated (2.0.1)
diff-lcs (1.2.4)
ejs (1.1.1)
eventmachine (1.0.3)
execjs (2.0.1, 1.4.0)
faker (1.1.2)
faye-websocket (0.4.7)
ffi (1.9.0)
gherkin (2.12.0, 2.7.7)
grit (2.5.0)
haml (4.0.3)
handlebars_assets (0.14.1, 0.13.0)
hike (1.2.3)
http_parser.rb (0.5.3)
httpclient (2.3.3)
i18n (0.6.5, 0.6.4)
io-console (0.3)
json (1.5.5)
launchy (2.3.0)
libwebsocket (0.1.8)
mime-types (1.25, 1.23)
mini_portile (0.5.0)
minitest (4.7.5, 2.5.1)
multi_json (1.7.9, 1.7.6)
nokogiri (1.6.0)
oj (2.1.4, 2.0.14)
open4 (1.3.0)
page-object (0.9.0)
page_navigation (0.9)
Platform (0.4.0)
poltergeist (1.4.1, 1.3.0)
POpen4 (0.1.4)
posix-spawn (0.3.6)
rack (1.5.2)
rack-test (0.6.2)
rake (10.1.0, 10.0.4, 0.9.2.2)
rb-fsevent (0.9.3)
rdoc (3.9.5)
require_all (1.3.1)
rspec (2.14.1, 2.13.0)
rspec-core (2.14.5, 2.13.1)
rspec-expectations (2.14.3, 2.13.0)
rspec-mocks (2.14.3, 2.13.1)
rubygems-bundler (1.2.2, 1.1.1)
rubyzip (0.9.9)
rvm (1.11.3.8, 1.11.3.7)
sass (3.2.10, 3.2.9)
selenium-webdriver (2.35.1, 2.33.0)
sequel (3.48.0)
shoulda-context (1.1.2)
simplecov (0.7.1)
simplecov-html (0.7.1)
sprockets (2.10.0, 2.8.2)
term-ansicolor (1.2.2)
test-unit (2.5.5)
test-unit-capybara (1.0.4)
thread_safe (0.1.2)
tilt (1.4.1)
tins (0.8.0)
tzinfo (0.3.37)
version (1.0.0)
watir-webdriver (0.6.4)
websocket (1.0.7)
websocket-driver (0.2.3)
xpath (2.0.0, 0.1.4)
yml_reader (0.2)
yui-compressor (0.11.0, 0.9.6)
My folder structure is as like this:
>selenium
>spec
spec_helper.rb
>features (contains my rspec tests)
If I roll back to rspec 2.13 my tests start working again but I wish to update this gem as I installed the require_all gem version 1.3.1 which requires rspec 2.14.1 (http://rubygems.org/gems/require_all/versions/1.3.1)
Has anyone else experienced this?
Upvotes: 0
Views: 393
Reputation: 46836
One of the changes in RSpec 2.14 was:
Rather than always adding spec to the load path, add the configured --default-path to the load path (which defaults to spec). This better supports folks who choose to put their specs in a different directory
This means that the selenium/spec folder is no longer automatically added to the $LOAD_PATH. As a result, the spec_helper will not be found.
In your spec files, you could change them to be:
require_relative '../spec_helper'
You could manually add the selenium/spec folder to your $LOAD_PATH, but I am not sure of an easy way to do that.
Upvotes: 1