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

Thomas Bergman
Thomas Bergman
1,320 Points

My initial "rake spec" fails

Hi all,

When I run the initial "bin/rake spec" command (~1 min in the video), I get a LoadError. See the console output here:

http://pastebin.com/i09m9Pkp

It seems that a file is missing when active_support is trying to load the dependencies. Can anyone help me figure out what's wrong? Thanks, much appreciated!

My setup is: Ruby 2.2.0 Rails 4.2.0 rspec 2.14.8

Michael Liquori
Michael Liquori
8,131 Points

I have the same problem. Are you on Windows? (I am)

According to this link,

As of September 2014, the current version of rspec is broken in Windows. If you want to follow along on your own computer, when installing the gem, instead of "gem install rspec", type "gem install rspec -v 2.14.1" instead.

However, that does not fix it for me automatically, perhaps because i've already installed following the videos. So, I am lost. Any help?

3 Answers

Michael Liquori
Michael Liquori
8,131 Points

Here is what worked for me:

  1. Open db folder
  2. delete test.sqlite3
  3. duplicate development.sqlite3 and rename it test.sqlite3

Source: StackOverflow

I did not need to use the older version as mentioned in my comment above (using bundler etc. just as the videos say.)

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

Try simply running rake spec without the bin/, then try rspec or bundle exec rspec if this didn't help. I also recently had some problems with gems under Ruby 2.2.0, so you can later try using some older version of ruby to see if that's the cause (for example rvm install 2.1.5, rvm use 2.1.5, bundle install and then rake spec or rspec or bundle exec rspec).

markd2
markd2
5,253 Points

I had this issue on my Mac.

Follow the instruction at https://github.com/rspec/rspec-rails.

It updates for newer versions of Rails. I think it was requiring a newer version of Rails (~> 3.0) in the Gemfile.

Also I had to install rspec via: gem install rspec followed by: rspec --init.