Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialRichard Luick
10,955 Pointsrake spec failure
Hello everyone, I am having a real tough time running the "rake spec" test on my ToDo list application. I have been all over the message boards online and have yet to find a solution to my issue. This has been frustrating me all day and is preventing me from moving on with the course. I have pasted the error message below. Any help is greatly appreciated. Thank you.
C:\Users\Rich\Desktop\Web Projects\GitHub\ODOT>rake spec
C:/Ruby200-x64/bin/ruby.exe -S rspec ./spec/controllers/to_dp_lists_controller_s
pec.rb ./spec/helpers/to_dp_lists_helper_spec.rb ./spec/models/to_dp_list_spec.r
b ./spec/requests/to_dp_lists_spec.rb ./spec/routing/to_dp_lists_routing_spec.rb
./spec/views/to_dp_lists/edit.html.erb_spec.rb ./spec/views/to_dp_lists/index.h
tml.erb_spec.rb ./spec/views/to_dp_lists/new.html.erb_spec.rb ./spec/views/to_dp
lists/show.html.erb_spec.rb
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/activesupport-4.1.1/lib/active_support/d
ependencies.rb:247:in require': cannot load such file -- cabybara/rspec (LoadEr
ror)
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/activesupport-4.1.1/lib/act
ive_support/dependencies.rb:247:in
block in require'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/activesupport-4.1.1/lib/act
ive_support/dependencies.rb:232:in load_dependency'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/activesupport-4.1.1/lib/act
ive_support/dependencies.rb:247:in
require'
from C:/Users/Rich/Desktop/Web Projects/GitHub/ODOT/spec/spec_helper.rb:
6:in `<top (required)>'
from C:/Users/Rich/Desktop/Web Projects/GitHub/ODOT/spec/controllers/to
dp_lists_controller_spec.rb:1:in require'
from C:/Users/Rich/Desktop/Web Projects/GitHub/ODOT/spec/controllers/to_
dp_lists_controller_spec.rb:1:in
<top (required)>'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rspec-core-2.99.1/lib/rspec
/core/configuration.rb:1065:in load'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rspec-core-2.99.1/lib/rspec
/core/configuration.rb:1065:in
block in load_spec_files'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rspec-core-2.99.1/lib/rspec
/core/configuration.rb:1065:in each'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rspec-core-2.99.1/lib/rspec
/core/configuration.rb:1065:in
load_spec_files'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rspec-core-2.99.1/lib/rspec
/core/command_line.rb:18:in run'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rspec-core-2.99.1/lib/rspec
/core/runner.rb:103:in
run'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rspec-core-2.99.1/lib/rspec
/core/runner.rb:17:in `block in autorun'
C:/Ruby200-x64/bin/ruby.exe -S rspec ./spec/controllers/to_dp_lists_controller_s
pec.rb ./spec/helpers/to_dp_lists_helper_spec.rb ./spec/models/to_dp_list_spec.r
b ./spec/requests/to_dp_lists_spec.rb ./spec/routing/to_dp_lists_routing_spec.rb
./spec/views/to_dp_lists/edit.html.erb_spec.rb ./spec/views/to_dp_lists/index.h
tml.erb_spec.rb ./spec/views/to_dp_lists/new.html.erb_spec.rb ./spec/views/to_dp
_lists/show.html.erb_spec.rb failed
2 Answers
Robert Ho
Courses Plus Student 11,383 Pointsalrite, after you installed Capybara, did you run these steps in video 2 (Set up Git and Add Gems)?
- bin/rails generate rspec:install
- open spec/spec_helper.rb and type require 'capybara/rspec'
- then type bundle binstubs rspec-core
For reference, he does this 4:50 min mark in the video.
Robert Ho
Courses Plus Student 11,383 PointsHey Richard,
Which video are you on when you get this error? It seems that error shows you don't have capybara installed. Can you copy and paste your gem file? The second video of the "Build a Simple Todo List Application" set of videos shows you how to install Capybara. You have to first include it in the Gemfile and then second include it in the spec_helper.rb file. Hope this helps!
Richard Luick
10,955 PointsHi Robert, thanks for the resposne. I am currently encountering this error on the "Write our first tests" video. I will copy my GemFile below. Thank you.
source 'https://rubygems.org'
gem 'rails', '4.1.1' gem 'sqlite3' gem 'sass-rails', '~> 4.0.3' gem 'uglifier', '>= 1.3.0' gem 'coffee-rails', '~> 4.0.0' gem 'jquery-rails' gem 'turbolinks' gem 'jbuilder', '~> 2.0' gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw]
group :doc do
gem 'sdoc', require: false
end
group :development, :test do gem 'rspec-rails', '~> 2.0' end
group :test do gem 'capybara', '~> 2.1.0' end
Richard Luick
10,955 PointsRichard Luick
10,955 PointsI believe I did as I was following along with the video when I initially set it up. However, to be sure I am going to re-watch that video and ensure that I am following those 3 steps you posted. I will let you know the results once I go through it again.
Richard Luick
10,955 PointsRichard Luick
10,955 PointsRobert, good news! I went back and re-did everything paying careful attention to the steps you pointed out and everything worked fine. Although I am not sure exactly what happened the first time, I was able to get everything up and running. Thank you for the help