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

General Discussion

Rails: Todo Application Test Issue..

I'm following the video letter for letter but when I run the 'bin/rspec spec/features/todo_lists/create_spec.rb' I get the following error:

Macintosh:odot gafrong$ bin/rspec spec/features/todo_lists/create_spec.rb /usr/local/rvm/gems/ruby-2.0.0-p451/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in require': cannot load such file -- capybar/rspec (LoadError) from /usr/local/rvm/gems/ruby-2.0.0-p451/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:inblock in require' from /usr/local/rvm/gems/ruby-2.0.0-p451/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:232:in load_dependency' from /usr/local/rvm/gems/ruby-2.0.0-p451/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:inrequire' from /Users/gafrong/Source/odot/spec/spec_helper.rb:6:in <top (required)>' from /Users/gafrong/Source/odot/spec/features/todo_lists/create_spec.rb:1:inrequire' from /Users/gafrong/Source/odot/spec/features/todo_lists/create_spec.rb:1:in <top (required)>' from /usr/local/rvm/gems/ruby-2.0.0-p451/gems/rspec-core-2.99.0/lib/rspec/core/configuration.rb:1065:inload' from /usr/local/rvm/gems/ruby-2.0.0-p451/gems/rspec-core-2.99.0/lib/rspec/core/configuration.rb:1065:in block in load_spec_files' from /usr/local/rvm/gems/ruby-2.0.0-p451/gems/rspec-core-2.99.0/lib/rspec/core/configuration.rb:1065:ineach' from /usr/local/rvm/gems/ruby-2.0.0-p451/gems/rspec-core-2.99.0/lib/rspec/core/configuration.rb:1065:in load_spec_files' from /usr/local/rvm/gems/ruby-2.0.0-p451/gems/rspec-core-2.99.0/lib/rspec/core/command_line.rb:18:inrun' from /usr/local/rvm/gems/ruby-2.0.0-p451/gems/rspec-core-2.99.0/lib/rspec/core/runner.rb:89:in run' from /usr/local/rvm/gems/ruby-2.0.0-p451/gems/rspec-core-2.99.0/lib/rspec/core/runner.rb:17:inblock in autorun' Macintosh:odot gafrong$

Please help!

1 Answer

I had a lot of trouble with the tests- lots of no method errors on visit etc.

First — I looked at the current gem repos on Github. They often have the best information for installing a gem. Things can change significantly between versions.

Here's what worked for me (Jason might want to chime in). In the gem file:

group :development, :test  do
  gem 'rspec-rails'
end

group :test do
  gem 'rspec-rails'
  gem 'capybara'
end

In the create_spec.rb

instead of

require 'spec_helper'

I used

require 'rails_helper'

in spec_helper.rb I used:

require 'capybara/rspec'

Now I'm on my way!

Awesome! Thanks very much Charlie!