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 trialChris Gray
10,305 PointsRake aborted! NoMethodError: undefined method `last_comment'
Weird error on running rake db:migrate, when I try it I get
rake aborted!
NoMethodError: undefined method last_comment' for #<Rake::Application:0x007fe1f29c8cf0>
/Users/chrisgray/personal/treehouse/odot/Rakefile:6:in
<top (required)>'
(See full trace by running task with --trace)
When I run it with --trace it seems to point to the issue being with rspec but I can't find any other occurence of this issue in Rails 4 with google, the only thing I can find are two references to the issue in Rails 2.
I've tried searching through the files to find any mention of the method and nothing comes up.
Hope this helps for a quick resolution as I cannot progress the videos without it.
3 Answers
Unsubscribed User
4,023 PointsIf this is the same issue I had, you'll have to uninstall rake 11.0, go into Gemfile.lock, go to line 81 and change the rake file version number (I had to change mine to 0.9..6). Hope that helps, damn rake file had me frustrated for a while.
Steve Hunter
57,712 PointsHi Christopher,
I've never seen that error from that file. However, you're running a migration, so the issue may be lurking within the migration, perhaps?
Can you post your migration file and the current schema, please?
Steve.
Chris Gray
10,305 PointsUnfortunately this happens even before I generate the migration, if I try rake it also happens, the rakefile is completely untouched.
Steve Hunter
57,712 PointsOK - you said you were running rake db:migrate
so I thought there was a generated migration to run.
Chris Gray
10,305 PointsFirst noticed the issue after I ran rake db:migrate, suspected I may have done something with the migration so destroyed and reverted back to just after I generated the application and had rspec and capybara installed and ran rake, still face the same issue
Steve Hunter
57,712 PointsHave you tried running bundle exec rake
? It's difficult to suggest much if you're at a bare-bones app with just rspec and capybara installed. How much work to rebuild a new app?
Chris Gray
10,305 PointsNot a huge amount to rebuild just frustrating. I tried both bundle exec and bin/rake and neither chased the issue will try rebuilding to see if that solves the issue
Joel Buzzanco
Courses Plus Student 2,738 PointsHi, I am having the same issue as Chris Gray,
how do you uninstall rake 11.0 ? is it via command prompt? Then you said to change the rake file version to 0.9.6 . I know this may seem like a dumb question but I guess I don't know how to uninstall it.
nulled
1,890 Pointstreehouse:~/projects/odot (master *) $ gem uninstall rake 11.0
Select gem to uninstall:
1. rake-10.5.0
2. rake-10.1.0
3. rake-11.1.2
4. All versions
> 3.
Successfully uninstalled rake-11.1.2
Chris Gray
10,305 PointsChris Gray
10,305 PointsBig thanks this solved the issue
Chris Gray
10,305 PointsChris Gray
10,305 PointsBig thanks this solved the issue
Steve Hunter
57,712 PointsSteve Hunter
57,712 PointsGood work!
Joel Buzzanco
Courses Plus Student 2,738 PointsJoel Buzzanco
Courses Plus Student 2,738 PointsHi, I am having the same issue as Chris Gray,
how do you uninstall rake 11.0 ? is it via command prompt? Then you said to change the rake file version to 0.9.6 . I know this may seem like a dumb question but I guess I don't know how to uninstall it.
Chris Gray
10,305 PointsChris Gray
10,305 PointsJoel Buzzanco all you need to do is go to your Gemfile.lock file and find rake in there and change the version number, if you then run bundle install you should solve the issue.