Hai, today when i created an empty database
rake db:create
for a rails project, i faced the following error
Error:
rake aborted!
undefined method `task’ for #<Pagescroll::Application:0xb74dcb0c>
(See full trace by running task with –trace)
To solve it, i followed the below steps which i found while surfing
The issue is because of the version of rake
Steps:
1. gem uninstall rake -v 0.9
2. gem install rake -v 0.8.7
3. Edit the Gemfile and add
i. gem ‘rake’, ’0.8.7′
4. bundle update
Now when i gave
rake db:create
It works
Thanks. It worked for me.
Just ran into this problem setting up a new rails app – Thanks for the tip!
Thanks for this, it helped me when I ran into the problem this morning.
One recommendation I’d make: don’t use the blanket “bundle update” unless you really want to update all your gems. I’m pretty sure I installed the (troublesome) rake 0.9.0 when I did “bundle update” to fix an earlier problem.
I’m no bundler expert, but I think in this case you want “bundle update rake” — so it only touches rake.
Hai thanks for the information
Excellent. Thanks! You saved my day.
Worked for me. Thanks a bunch!
Hi, that’s really helpful, since I’m rails newbies, thank you
Person who runs this site. Major thanks. I just spent the last two days trying to fix this and it works. Thank you. Thank you. Thank you!
[...] http://sraji.wordpress.com/2011/05/25/soultion-for-rake-aborted-undefined-method-task-in-rails-3–0… [...]
Dude you have no idea how much relief your simple solution brought me. I spent 2 complete days trying to work around this issue and even installed Ubuntu after getting tired of solving the issue! Thanks a ton!