I'm trying to use mongoid but it outputs this error:
uninitialized constant 'Mongo'
Here is my code:
require "mongoid"
Mongoid.configure do |config|
config.master = Mongo::Connection.new("localhost",27017).db("arthist")
end
class Artist
include Mongoid::Document
field :name, type: String
end
a = Artist.create(name: "hoge")
Do you have any idea?
include gem mongo in your Gemfile and restart the server it should do the trick.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With