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

Josiah Schaefer
Josiah Schaefer
7,489 Points

Is anyone else getting Deprecation errors when they run $rake spec ?

I get a long string of deprecation errors, saying it was called from todo_lists_helper_spec.rb.

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

Can you paste them here? It's difficult to tell why they are there unless we know what they say.

4 Answers

Pavel Razuvayev
Pavel Razuvayev
4,128 Points

You can try adding this to your spec_helper.rb file

RSpec.configure do |config|
    config.expose_current_running_example_as :example
end

This course is fairly up to date, the thing with Rails, it's always updating. If you want to learn Rails you'll have to dig into resolving issues on your own sooner or later. Don't be afraid to do a bit extra work for this course, it's pretty good.

Josiah Schaefer
Josiah Schaefer
7,489 Points

I already have that in my spec_helper file but I'm still getting the error. I posted my code in another post that can be found here: https://teamtreehouse.com/forum/errors-with-rake

Justin Black
Justin Black
24,793 Points

Part of this is that the rspec version is 2.99.0 ( as referenced by typing bundle in the CLI ). As explained here: https://github.com/rspec/rspec-core/issues/1208 they suggest you replace 'pending' with 'xit'.

The other two errors that'll show up are on in todo_lists_controller_spec.rb

line 75:

assigns(:todo_list).should be_persisted
  • unkown fix

and line 156:

response.should redirect_to(todo_lists_url)

changing that to a non-named url like so:

response.should redirect_to("/todo_lists")

will fix it. Everything else is as normal.

Gavin Ralston
Gavin Ralston
28,770 Points

You might be running a different version of ruby or rails than the tutorial is using.

One way to change this is by using rvm so you can change your ruby version to match the tutorial. Later on, you may find you'll go from getting a few warnings to finding that packages will work in a completely different fashion, or you may even need to find a substitute package to get things to work.

On the upside, if you tough it out and do a little research while using a newer version, you'll find that you'll learn a bit more about ruby and rails along the way.

Josiah Schaefer
Josiah Schaefer
7,489 Points

Thanks for the response! I agree that it would be worthwhile to hash this out, it's just been a frustrating ordeal since I often am only able to dedicate an hour at a time to getting back into it and trying to figure out the bugs. Maybe at some point I will do as you say and try the virtual machine.

Josiah Schaefer
Josiah Schaefer
7,489 Points

Thanks guys, but I've decided to learn Ruby on Rails from a different source that is up to date. I've run into too many version difference difficulties in this track. Railstutorial.org/book for anyone who is interested!

Gavin Ralston
Gavin Ralston
28,770 Points

Nice. It looks like they recently updated to include the newest version of Rails. I don't think that entire tutorial was up to date the last I looked at it.

I still strongly suggest you look into installing your own environment and learning how to deal with gem management. It can be a really good thing to know how to fix things when they (inevitably) wind up breaking. If you're going to be a full stack developer, you're absolutely going to need to be able to "decode" those messages you get.