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 trialRishi Shah
5,298 PointsWhy does bin/rake spec fail?
This is what I get --
treehouse:~/projects/odot (master) $ bin/rake spec
/home/treehouse/.rbenv/versions/2.0.0-p353/bin/ruby -S rspec ./spec/controllers/todo_lists_controller_spec.rb ./spec/helpers/todo_lists_helper_spec.rb ./spec/models/todo_list_spec.rb ./spec/requests/todo_lists_spec.rb ./spec/routing/todo_lists_routing_spec.rb ./spec/views/todo_lists/edit.html.erb_spec.rb ./spec/views/todo_lists/index.html.erb_spec.rb ./spec/views/todo_lists/new.html.erb_spec.rb ./spec/views/todo_lists/show.html.erb_spec.rb
/home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/nokogiri-1.6.3.1/lib/nokogiri.rb:29:in require': cannot load such file -- nokogiri/nokogiri (LoadError)
from /home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/nokogiri-1.6.3.1/lib/nokogiri.rb:29:in
rescue in <top (required)>'
from /home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/nokogiri-1.6.3.1/lib/nokogiri.rb:25:in <top (required)>'
from /home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/capybara-2.1.0/lib/capybara.rb:2:in
require'
from /home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/capybara-2.1.0/lib/capybara.rb:2:in <top (required)>'
from /home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in
require'
from /home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in block (2 levels) in require'
from /home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in
each'
from /home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:70:in block in require'
from /home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in
each'
from /home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/runtime.rb:59:in require'
from /home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler.rb:132:in
require'
from /home/treehouse/projects/odot/config/application.rb:7:in <top (required)>'
from /home/treehouse/projects/odot/config/environment.rb:2:in
require'
from /home/treehouse/projects/odot/config/environment.rb:2:in <top (required)>'
from /home/treehouse/projects/odot/spec/spec_helper.rb:3:in
require'
from /home/treehouse/projects/odot/spec/spec_helper.rb:3:in <top (required)>'
from /home/treehouse/projects/odot/spec/controllers/todo_lists_controller_spec.rb:1:in
require'
from /home/treehouse/projects/odot/spec/controllers/todo_lists_controller_spec.rb:1:in <top (required)>'
from /home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/rspec-core-2.99.2/lib/rspec/core/configuration.rb:1065:in
load'
from /home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/rspec-core-2.99.2/lib/rspec/core/configuration.rb:1065:in block in load_spec_files'
from /home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/rspec-core-2.99.2/lib/rspec/core/configuration.rb:1065:in
each'
from /home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/rspec-core-2.99.2/lib/rspec/core/configuration.rb:1065:in load_spec_files'
from /home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/rspec-core-2.99.2/lib/rspec/core/command_line.rb:18:in
run'
from /home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/rspec-core-2.99.2/lib/rspec/core/runner.rb:103:in run'
from /home/treehouse/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/rspec-core-2.99.2/lib/rspec/core/runner.rb:17:in
block in autorun'
/home/treehouse/.rbenv/versions/2.0.0-p353/bin/ruby -S rspec ./spec/controllers/todo_lists_controller_spec.rb ./spec/helpers/todo_lists_helper_spec.rb ./spec/models/todo_list_spec.rb ./spec/requests/todo_lists_spec.rb ./spec/routing/todo_lists_routing_spec.rb ./spec/views/todo_lists/edit.html.erb_spec.rb ./spec/views/todo_lists/index.html.erb_spec.rb ./spec/views/todo_lists/new.html.erb_spec.rb ./spec/views/todo_lists/show.html.erb_spec.rb failed
Why does it fail?
5 Answers
Maciej Czuchnowski
36,441 PointsI downloaded you code and the app works fine. I can't get tests to run because of a different error than you are getting. Can't do more for you I'm afraid. You should reinstall the VM and start from scratch or download Jason's app and use it as you starting code.
Maciej Czuchnowski
36,441 PointsWhat system are you working on? Did you use the virtual machine?Did you install the whole Ruby and Rails environment successfully? Can you upload your code to github so that we could take a look?
Rishi Shah
5,298 PointsMaceij -- I'm using the virtual machine right now and looking at my todo_list rails app. I accidentally installed something called nokogiri when setting up though
Maciej Czuchnowski
36,441 PointsOK, can you try and reinstall the virtual machine? I never managed to find a good answer for nokogiri problems and I never tried using the treehouse virtual machines. I think it wasn't your fault, capybara seems to be dependent on nokogiri somehow.
Rishi Shah
5,298 PointsRishi Shah
5,298 Pointshow can I reinstall the VM?
Maciej Czuchnowski
36,441 PointsI'm not sure, uninstall and go through the process again according to videos ;)
James demby
10,296 PointsI am getting the exact same thing and I have followed the videos exactly from the start. I am guessing that something had been changed somewhere along the way of the download path and these videos. The videos are over 2 years old and the version of Ruby I installed does not match theirs.
Bummer :(
Herb Sih
Courses Plus Student 6,345 PointsI am also getting this error.
Gavin Ralston
28,770 PointsI know this is an old post, but isn't the stack trace saying there's (ultimately) a problem with nokogiri?
If you ever come back to this, and you're on a linux/osx machine you could try:
apt-get install nokogiri
might just do the trick.