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 trial

Ruby Build a Todo List Application with Rails 4 Build a Todo List Application with Rails 4 Write Our First Tests

Why 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:inrescue 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:inrequire' 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:inrequire' 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:ineach' 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:ineach' 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:inrequire' from /home/treehouse/projects/odot/config/application.rb:7:in <top (required)>' from /home/treehouse/projects/odot/config/environment.rb:2:inrequire' from /home/treehouse/projects/odot/config/environment.rb:2:in <top (required)>' from /home/treehouse/projects/odot/spec/spec_helper.rb:3:inrequire' 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:inrequire' 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:inload' 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:ineach' 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:inrun' 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:inblock 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
Maciej Czuchnowski
36,441 Points

I 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
Maciej Czuchnowski
36,441 Points

What 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?

Maceij -- 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
Maciej Czuchnowski
36,441 Points

OK, 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.

how can I reinstall the VM?

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

I'm not sure, uninstall and go through the process again according to videos ;)

James demby
James demby
10,296 Points

I 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 :(

I am also getting this error.

Gavin Ralston
Gavin Ralston
28,770 Points

I 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.