Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Trouble uploading files to gridfs #74

sabcio opened this Issue Nov 30, 2012 · 3 comments


None yet
3 participants

sabcio commented Nov 30, 2012

I have uploaded a file via carrierwave-mongoid and I can't fetch it nor from within my Rails app nor with mongofiles. Is carrierwave-mongoid uploading a corrupted file?

$ mongofiles -d atlas_development list           
connected to:
uploads/alfa_logo2.jpg  68125

$ mongofiles get uploads/alfa_logo2.jpg                                                                                                                   
connected to:
assertion: 13325 couldn't open file: uploads/alfa_logo2.jpg

I can upload and download files with mongofiles.

My Gemfile:

gem 'mongoid'
gem 'carrierwave'
gem "carrierwave-mongoid",
  git: "git://github.com/jnicklas/carrierwave-mongoid.git",
  branch: "mongoid-3.0"

Carrierwave configuration:

CarrierWave.configure do |config|
  config.storage = :grid_fs
  config.root = Rails.root.join('tmp')
  config.cache_dir = "uploads"
  config.grid_fs_access_url = "/system/images"

Did you manage to find out the cause?

I'm having similar issue, although not exactly the same.


rmm5t commented Jan 9, 2013

@sabcio Does this problem still exhibit itself with the official carrierwave-mongoid v0.3.0 gem release? The mongoid-3.0 branch is now outdated.

If it still exhibits itself with v0.3.0, could you please share the Uploader that you're using, and the declaration of the uploader in your Mongoid document? Also, is this a fresh install or an upgrade from a previous version of carrierwave-mongoid?

sabcio commented Jan 9, 2013

@rmm5t I don't remember exactly how I got it working within Rails, I'm still using the mongoid-3.0 branch.

but mongofiles get still returns the same error.

@sabcio sabcio closed this Jan 9, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment