Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why are there no rake tasks in this mongoid Rails 3 project?

https://github.com/memphis518/Garden-Dating-Service

The public repo above is a community coding project we're working on for Austin Community Gardens, and it's a fairly simple project so far, but for some reason rake db:seed doesn't work ("Don't know how to build task db:seed"), and when you run rake -T it reveals no rake tasks at all.

MongoID documentation says it provides most of the usual DB-related rake tasks - I can't figure out why they're not there.

like image 582
mltsy Avatar asked Jan 16 '23 02:01

mltsy


1 Answers

I had the similar problem with Rails 3.X, although the mongoid Gem was included in my Gemfile. I could solve the problem by explicitly requiring the database.rake file from the mongoid gem. I added this 2 lines to my Rakefile:

spec = Gem::Specification.find_by_name 'mongoid'
load "#{spec.gem_dir}/lib/mongoid/railties/database.rake"

That works for me.

like image 165
Robert Reiz Avatar answered Mar 04 '23 04:03

Robert Reiz