Questions tagged [carrierwave]

A modern ruby gem for file uploads in Rails and other frameworks, similar to paperclip and attachment_fu

This tag should be for questions that involve the carrierwave gem.

The github repository for carrierwave https://github.com/jnicklas/carrierwave has all of the important information about the gem.

An excellent Railscast on carrierwave: http://railscasts.com/episodes/253-carrierwave-file-uploads.

The ASCIICasts version is at http://asciicasts.com/episodes/253-carrierwave-file-uploads

A GoRails screencast is at https://gorails.com/episodes/file-uploading-with-carrierwave.

3028 questions
16
votes
1 answer

Carrierwave check if remote file exists via fog

I know I'm missing something really easy here... CarrierWave::Storage::Fog::File has a method exists? How do I use it? I'm just trying to check whether a previously uploaded file exists on the remote storage. Neither my image object, nor my…
Demelziraptor
  • 1,545
  • 1
  • 14
  • 20
15
votes
3 answers

Carrierwave temp directory set to uploads/tmp folder

I started using Carrierwave, and I found out that it stores temporary files at multiple places depending on whether it is testing or delayed job. If it is done during testing(rspec), the temp files will be at RAILS_ROOT/uploads/tmp directory. If it…
lulalala
  • 17,572
  • 15
  • 110
  • 169
15
votes
2 answers

Use Carrierwave with Active Admin

Did any of you guys manage to get Active Admin with Carrierwave working? When I installed AA everything worked fine but the image file upload fields were plain text fields so added following: ActiveAdmin.register Club do form do |f| f.inputs…
Cojones
  • 2,930
  • 4
  • 29
  • 41
15
votes
1 answer

rmagick leads to server shutdown

everyone! I was following Railscasts episode #253, using CarrierWave to do image upload. Everything was fine to display the original image, even though the image looked quite big in the browser. I strictly followed Ryan Bates' instructions. But,…
Leo
  • 311
  • 2
  • 11
15
votes
1 answer

How to upload a local file to a Carrierwave model?

I'm using Carrierwave to handle image uploads, but I'm not using a form, instead I use local files in the server. How can I make this work? @user = User.first image_path = "/tmp/pic-s7b28.jpg" @user.image = image_path @user.save!
CodeOverload
  • 47,274
  • 54
  • 131
  • 219
15
votes
1 answer

undefined method `fog_host='

When i'm trying to run my application, i'm getting the following error: config/initializers/carrierwave.rb:4: undefined method `fog_host=' for CarrierWave::Uploader::Base:Class (NoMethodError) Here is my initializers/carrierwave.rb…
mbajur
  • 4,406
  • 5
  • 49
  • 79
14
votes
2 answers

Best Ruby on Rails Architecture for Image Heavy App

I'm building an application that allows for large amounts of photo uploads at once, and wanted to know what the best setup would be to tackle this. This is what I am using so far: Jquery File Upload: allows users to drag and drop…
14
votes
1 answer

How to use Fog with CarrierWave only in Production

I am using Heroku and S3 with my Rails app. I only have the fog gem installed in production mode because my local computer is a piece of junk. Anyway, it works fine this way and has proven to be the better solution than pulling my hair out to get…
spitfire109
  • 9,651
  • 3
  • 20
  • 28
14
votes
1 answer

Heading into 2013, should I go with Dragonfly or Paperclip or Carrierwave?

I am just another average joe hoping to jump onto the social network bandwagon. I'd like to know which photo uploading/resizing gem I should use for users of my app. It would be great if you could explain why.
pratski
  • 1,448
  • 2
  • 22
  • 37
14
votes
2 answers

301 Moved Permanently after S3 uploading

Im trying to upload images to S3 on Ruby on Rails using carrierwave and fog gems, images are uploaded correctly but when I try tu save the model containing information about the image that was just uploaded Im getting this…
p1nox
  • 623
  • 1
  • 7
  • 13
14
votes
3 answers

Best way to show image previews before upload in rails & carrierwave

I've been using rails for past few days and wanted to know what is best way to show image previews before upload in rails & carrierwave. I came across a few options like using plupload or jquery file upload or using uploadify.
random
  • 10,238
  • 8
  • 57
  • 101
13
votes
4 answers

How to stub carrierwave in Rspec?

I want to stub carrierwave to prevent it from fetch images on the web during my tests. How would I stub things to achieve this? My crawler parses a remote web page, and saves one image url into the model. Carrierwave will fetch that image…
lulalala
  • 17,572
  • 15
  • 110
  • 169
13
votes
2 answers

Carrierwave gem. How to rename uploaded image versions after recreating them?

I have similar models as described in RailsCasts: app/models/resident.rb: class Resident < ActiveRecord::Base include PhotoConcern end app/models/employee.rb: class Employee < ActiveRecord::Base include…
Evmorov
  • 1,134
  • 22
  • 28
13
votes
1 answer

Rails: Uploading dropzone, S3, carrierwave, not working in Safari, but works in Google Chrome

I'm using dropzone with S3 and carrierwave. I'm able to upload images through Google Chrome, but I can't get it to work with Safari, which is weird. This is my form = nested_form_for @trip, html: { multipart: true, id: 'fileupload', class:…
hellomello
  • 8,219
  • 39
  • 151
  • 297
13
votes
4 answers

How to handle a file_as_string (generated by Prawn) so that it is accepted by Carrierwave?

I'm using Prawn to generate a PDF from the controller of a Rails app, ... respond_to do |format| format.pdf do pdf = GenerateReportPdf.new(@object, view_context) send_data pdf.render, filename: "Report", type: "application/pdf",…
Andy Harvey
  • 12,333
  • 17
  • 93
  • 185