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 Editing Todo Lists

mateusz sawka
mateusz sawka
13,222 Points

cannot load spec_helper

Everything was working fine, until I restarted my computer. Then when running test I started getting messages like the one below. It says that it cannot load the spec_helper file, while I was not doinf anything to it, and definitely I was not changing anything in kernel_require.rb

Could you please suggest some solutions?

The message I get after running rspec:

C:\Ruby200-x64\projects\ODOT\odot\spec\features\todo_lists>rspec create_spec.rb

C:/Ruby200-x64/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:i n require': cannot load such file -- spec_helper (LoadError) from C:/Ruby200-x64/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_re quire.rb:55:inrequire' from C:/Ruby200-x64/projects/ODOT/odot/spec/features/todo_lists/create_s pec.rb:1:in <top (required)>' from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rspec-core-2.99.2/lib/rspec /core/configuration.rb:1065:inload' from C:/Ruby200-x64/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 C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rspec-core-2.99.2/lib/rspec /core/configuration.rb:1065:ineach' from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rspec-core-2.99.2/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.2/lib/rspec /core/command_line.rb:18:inrun' from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rspec-core-2.99.2/lib/rspec /core/runner.rb:103:in run' from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rspec-core-2.99.2/lib/rspec /core/runner.rb:17:inblock in autorun'

4 Answers

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

rspec doesn't know where you keep that file. You have to enter path for it: rspec spec/features/todo_lists/create_spec.rb

Does Jason enter rspec create_spec.rb at any point?

mateusz sawka
mateusz sawka
13,222 Points

I thought it should work if my working directory was spec/features/todo_lists/. Anyway, even if I run it now as you suggest, I get a similar message

C:\Ruby200-x64\projects\ODOT\odot>rspec spec\features\to_do_lists\create_spec.rb

C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rspec-core-2.99.2/lib/rspec/core/configuration.rb:1065:in load': cannot load such file -- C:/Ruby200-x64/projects/ODOT/odot/spec/features/to_do_lists/create_spec.rb (LoadError) from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rspec-core-2.99.2/lib/rspec/core/configuration.rb:1065:inblock in load_spec_files' from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rspec-core-2.99.2/lib/rspec/core/configuration.rb:1065:in each' from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rspec-core-2.99.2/lib/rspec/core/configuration.rb:1065:inload_spec_files' from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rspec-core-2.99.2/lib/rspec/core/command_line.rb:18:in run' from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rspec-core-2.99.2/lib/rspec/core/runner.rb:103:inrun' from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rspec-core-2.99.2/lib/rspec/core/runner.rb:17:in `block in autorun'

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

to_do_lists or todo_lists? You use these two names of the folder, not sure which one is the real name.

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

In this case, since I don't use Windows, I can only suggest:

1) Try using 32-bit version of the installer (64-bit is known to have problems, 32-bit version may help)

2) Use a Unix-based system like Linux (dual boot or virtual machine using VMWare) or Mac. Rails development under Windows was always problematic and there's not much support online, since very few people use Windows for Rails.

3) Use online environment like Cloud9

mateusz sawka
mateusz sawka
13,222 Points

I always feel ashamed of not finding a typo myself... Thanks a lot for spending your time to help me out.

I will definitely check Cloud9 - are such platforms popular among programmers?

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

Not yet, since they are quite new. It's basically an Ubuntu virtual machine accesses through a browser. But they are getting increasingly popular, especially for learning purposes. Hartl describes the setup in his book:

https://www.railstutorial.org/book/beginning#sec-up_and_running

Although he uses the dedicated Rails Tutorial setup. You can simply use the pure Rails setup.