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 6809799
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T20:07:44+00:00 2026-05-26T20:07:44+00:00

I am using the carrierwave gem with Rmagick in a Rails app. I’ve set

  • 0

I am using the carrierwave gem with Rmagick in a Rails app. I’ve set up a new version in my uploader file:

class ImageUploader < CarrierWave::Uploader::Base   
  include CarrierWave::RMagick
  storage :file
  def store_dir
    "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
  end
  version :preview do
     process :resize_to_fill => [580, 350]
  end
end

Of course, I included rmagick and carrierwave in my gemfile. Now I try to load the preview version of my images in my views:

@product.photos.first.image.preview

This does not give any errors, but loads a broken image. If I copy the url of the image, I get a routing error (‘no route matches /path/to_my_imagesfolder/preview_image.png’). If I remove the preview method, the image loads properly.

What can the problem be? I thought maybe it was a permissions issue, but I set the uploads folder with 777 and it still fails.

Any ideas?

EDIT: I realized if I upload the images again the new versions are created. Is it possible to make Rmagick create them when they are requested (like TimThumb does in PHP) Or at least is there any command to batch create all the versions?

There must be a better way than uploading all the images…

  • 1 1 Answer
  • 0 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-26T20:07:45+00:00Added an answer on May 26, 2026 at 8:07 pm

    You can use .recreate_versions!

    For example:

    Product.all.each do |product|
      product.photos.each do |photo|
        photo.recreate_versions!
      end
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using the carrierwave gem to manage file uploads in my rails 3
In my rails 3 application, I am using carrierwave gem (version 0.5.6). I would
I'm making a rails 3.1 app using carrierwave to upload files to aws s3.
I'm using Carrierwave in my Rails app to handle image uploads. When I configure
My Rails app uses carrierwave to manage image uploads. I have a watermark version
I am using Rails 3 and carrierwave gem. My problem is the next: I
Rails noob here. I am using carrierwave in a rails 3 app so users
I'm using the carrierwave gem to upload file attachments to Google cloud storage. This
I'm using CarrierWave on my Rails 3 sample app. I want to validate the
I am using the carrierwave gem (http://github.com/jnicklas/carrierwave) for ruby on rails. How do I

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.