Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


New mongoid #49

swistaczek opened this Issue · 6 comments

4 participants

Ernest Bursa Edson Hilios Niels V Ryan McGeary
Ernest Bursa

I am trying to set carierwave with Mongoid but in new wersion Mongoid.database is undefined. What is new name of Mongoid.database method?

Edson Hilios

Now the Mongoid uses Moped for opening mongo sessions, there are new features that allow you to connect to multiple database at the same time, or even a cluster, so the object is more abstract than was before, and holds multiple host information.

Said that my best try in this issue is:

CarrierWave.configure do |config|
  config.grid_fs_database = Mongoid::Config.sessions[:default][:database]
  config.grid_fs_host     = Mongoid::Config.sessions[:default][:hosts].first :grid_fs

Let's see what the guys from carrierwave says about my conf. But hope that helps you.

Niels V

Mongoid 3 (or rather their mongodb driver, moped) does not support gridfs, see

Ryan McGeary

@nvdk carrierwave-mongoid uses moped-gridfs via the mongoid-3.0 branch. For now, that looks like this in your Gemfile:

gem "carrierwave-mongoid", :git => "git://", :branch => "mongoid-3.0"
Niels V

Ah cool didn't know that, thanks :)

Edson Hilios

Thats great, guys! Thanks

Ryan McGeary

Triaging. Closing this out now that carrierwave-mongoid 0.3.0 is out. It supports Mongoid 3.0 and no longer needs the grid_fs_xxx config options.

Ryan McGeary rmm5t closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.