Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3998384
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T07:31:08+00:00 2026-05-20T07:31:08+00:00

The problem is the following error which is thrown on mongoids save! action. Mongoid::Errors::Validations:

  • 0

The problem is the following error which is thrown on mongoids save! action.

Mongoid::Errors::Validations: Validation failed - Img failed to be processed.
~/.rvm/gems/ruby-1.8.7-p249/gems/mongoid-2.0.0.rc.7/lib/mongoid/persistence.rb:234:in `fail_validate!'
~/.rvm/gems/ruby-1.8.7-p249/gems/mongoid-2.0.0.rc.7/lib/mongoid/persistence.rb:75:in `save!'
./app.rb:29:in `POST /upload'

The setup is mostly the following:

require "sinatra"     # 1.1.2
require "mongoid"     # 2.0.0.beta.19
require "rmagick"     # 2.12.2
require "carrierwave" # 0.5.1
require "carrierwave/orm/mongoid"
require 'carrierwave/processing/rmagick'
....


Mongoid.database = Mongo::Connection.new('somehost', 1234).db('test')

class Uploader < CarrierWave::Uploader::Base
  include CarrierWave::RMagick
  storage :file

  def store_dir
    "uploads"
  end

 process :resize_to_fit => [80, 80]
end


class Image
  include Mongoid::Document

  mount_uploader :img, Uploader
end


....

post '/upload' do
  @img = Image.new
  @img.img = params[:file]
  @img.save!
  redirect '/'
end

The glitch is somewhere in the processing:

process :resize_to_fit => [80, 80]

If I remove this line. Everything works as expected.

  • 1 1 Answer
  • 3 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T07:31:08+00:00Added an answer on May 20, 2026 at 7:31 am

    Ok. I didn’t follow the traces deep enough:
    The problem was a missing jpeg-delegate in ImageMagick.
    So naturally processing of jpeg-files failed.

    The solution was to reinstall ImageMagick from source.

    Still it’s quite opaque when Mongoid throws an Error which is called from carrierwave because it gets an error from RMagick which was triggered by ImageMagick.

    Still. In retrospective it’s quite obvious 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The problem is taht I get the following error qhile deploying my project to
Hi people am having a problem am getting the following error: The ObjectContext instance
I have an error in map iterators. The problem is the following: class JacobianCol
Consider following code: My problem is: 1) I can't seem to cast the errors
I have the following problem: I have this multi-level array (nested array) which contains
I have a problem following from my previous problem . I also have the
Following problem: I want to render a news stream of short messages based on
The following problem happens on both Safari and Chrome, so probably a WebKit issue.
I have following problem: I have to make a ASP.NET Webapplication with a two-row
Given the following problem , I'd appreciate for any corrections since I have no

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.