Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Ruby Build a Todo List Application with Rails 4 Build a Todo List Application with Rails 4 Generate a Scaffold

Joel Buzzanco
PLUS
Joel Buzzanco
Courses Plus Student 2,738 Points

'rake db:migrate' gives the error 'rake aborted!'

When i run rake db:migrate I get the error 'rake aborted! NoMethodError: undefined method 'last_comment' for 3<Rake::Application:0x30814f8> C:/Users/TEST/projects/odot/rakefile:6:in `<top (required)>' (See full trace by running task with --trace)

I'm restarting this ruby todo list application over as I was having issues a few videos later, and it just seems like that possibly bc treehouse did this series with a former version of ruby, there have been a number of conflicts with the current ruby on rails for doing this application. I don't know, I guess I'm just getting frustrated bc it takes so long to solve simple issues that ends up being something stupid. Then that process would just repeat itself.

Anyways, if you know whats going wrong here, I'd appreciate your help. Thanks

It seems like someone else was having a similar issue with this. But I'm not too sure on how it was resolved. https://teamtreehouse.com/community/rake-aborted-nomethoderror-undefined-method-lastcomment

Martin Cornejo Saavedra
Martin Cornejo Saavedra
18,132 Points

I used a recent rails version (Rails 4.2.5.1) and had no problem. Maybe you do not have enough privilieges? Did you try using sudo rake?

Joel Buzzanco
Joel Buzzanco
Courses Plus Student 2,738 Points

Hi Martin Cornejo Saavedra,

I am using a recent rails version, but when I use sudo rake, it is not recognized as an internal or external command in the command prompt on my windows 10 machine. Maybe because I am using a newer ruby for this than treehouse is why I am having this issue, but I don't know.

1 Answer

nick wesley
nick wesley
1,331 Points

this helped me a bit, although I'm still having problems


http://stackoverflow.com/questions/35893584/nomethoderror-undefined-method-last-comment-after-upgrading-to-rake-11/35893941#35893941

in Rails quick fix can be edit ./Rakefile (in your app folder)

and add these lines before calling Rails.application.load_tasks:

module TempFixForRakeLastComment def last_comment last_description end end

Rake::Application.send :include, TempFixForRakeLastComment