Ask A Question

Notifications

You’re not receiving notifications from this thread.

Rails 4.0 with MongoDB and Mongoid Discussion

Chris Oliver asked in General

> rake
rake aborted!
Don't know how to build task 'default'

(See full trace by running task with --trace)

Reply

Yo. The ActiveRecord issue is a bit easier than you have described. When you create your app, just add the -O switch, and it will skip all AR.

rails new myapp -O

Reply

Fantastic. I'll update the post.

Reply
Alex Emelyanov Alex Emelyanov

I followed this tutorial on Rails 4.02 with latest Mongoid from Git. In my case it's also required to add this line in initializers code:
Mongoid.load!("path/to/your/mongoid.yml")

Reply

Maybe it's just me, but there doesn't seem to be a date on this post. Seems like it might be relevant, given the obviously time-sensitive nature of edge development.

Reply

It was posted about 3 months ago. I haven't kept up on Mongoid's development, but it looks like they've been working closer to 4.0.0: https://rubygems.org/gems/m...

Looks like it's pretty questionable as to eventual compatibility with Rails 4 (https://github.com/mongoid/... so these instructions should still be pretty up-to-date.

Reply
Ярослав Ничка Ярослав Ничка

Very useful, thanx!

Reply
Subodh Choure Subodh Choure

In my case, I changed in gemfile "gem 'mongoid', '~> 4', github: 'mongoid/mongoid'" to "gem 'mongoid', github: 'mongoid/mongoid'" and then run bundle install. This worked for me

Reply
Sushant Prusty Sushant Prusty

I have two collections in mongo. Can I use mongoid to join them based on their common field. Can I get some tutorial.

Reply

One Quick Question

Your Article looks intresting,...

Can you post some Usecases regarding, When one should use Mongodb with rails?

Besause I think with rails if your using Mongodb,

Rails makes it relational in many places using relations between models.

Its hard to write code with zero relations

Reply

That's up to you to make sure you've got a project that's worth using with it. There are lots of good articles on it that you can check out:

http://java.dzone.com/artic...
http://docs.mongodb.org/eco...
http://www.sarahmei.com/blo...

Reply
Hemant Gupta Hemant Gupta

Good Post, But gem 'mongoid', git: 'https://github.com/mongoid/... is working perfect...Thanks,

Reply
Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 85,972+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.