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
20
votes
2 answers

Factory with carrierwave upload field

Hello i need to build up Factory for my model, for example Factory.define :farm do |f| f.name { Factory.next :name } f.harvest '3' f.offers 'Random' f.latitude '43' f.longitude '-70' f.about 'We rocks!' f.logo { Factory.next :logo } #…
Petya petrov
  • 2,153
  • 5
  • 23
  • 35
20
votes
1 answer

How to test that a file is uploaded in a controller?

I'm trying to test that my user has a photo value when I upload an image. It works fine in the browser, and the basic functionality of the test passes, but if I try to assert that user.photo is not nil, it fails. Here's the test describe 'POST…
Greg Blass
  • 3,523
  • 29
  • 42
20
votes
1 answer

Carrierwave fog Amazon S3 images not displaying

I have installed carrierwave and fog, have successfully uploaded the images and viewed them the first time, but now it does not show the images anymore. Here is my config file app/config/initializers/carrierwave.rb CarrierWave.configure do…
Francois
  • 10,465
  • 4
  • 53
  • 64
19
votes
2 answers

Undefined Method Scale In CarrierWave

I'm trying to use this code in my uploader version :thumb do process :scale => [50, 50] end and I get an error saying undefined method `scale' for #<#:0x0fb4c8> I'm using Carrierwave with MiniMagick. How can I fix this…
qendu
  • 289
  • 2
  • 5
  • 12
19
votes
6 answers

RMagick complaining about libMagickCore.5.dylib not found in OSX

after running brew upgrade imagemagick, when I run rails s I'll get /Users/tomi/.rvm/gems/ruby-2.0.0-p247@ezaaa/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228:in `require':…
equivalent8
  • 13,754
  • 8
  • 81
  • 109
19
votes
2 answers

Rails 4 strong parameters param not found error with carrierwave

I'm having trouble with carrierwave and rails 4 strong parameters. I have a very simple model with a carrier wave upload button. I'd like to show an error message if someone submits the upload form without choosing a file to upload. Right now, I…
Lee McAlilly
  • 9,084
  • 12
  • 60
  • 94
18
votes
6 answers

Rails 3 test fixtures with carrierwave?

I'm working on upgrading from attachment_fu to carrierwave, since attachment_fu is broken in rails 3. None of the tests are able to run, because we have invalid fixtures that were using the syntax from attachment_fu for attachment files. For…
18
votes
2 answers

Access to main app secrets from Rails engine initializer

I have been trying (unsuccessfully) to access the main app's application secrets from within my Rails mountable engine. The whole point of a mountable engine is to provide modularity. Therefore a common pattern would be to provide configurable…
18
votes
4 answers

validate size of upload using Carrierwave

In our latest application we need to process some uploads, I've worked with paperclip before and everything just works! but we're giving carrierwave a try, it looks promising but, I can't find how to validate the size of an attachment, it seems like…
jpemberthy
  • 7,473
  • 8
  • 44
  • 52
18
votes
3 answers

Rails Carrierwave Base64 image upload

What is the best way to upload an image from a client to a Rails backend using Carrierwave. Right now our iOS developer is sending in the files as base64, so the requests come in like…
botbot
  • 7,299
  • 14
  • 58
  • 96
17
votes
3 answers

Undefined Method crop! Using Carrierwave with MiniMagick on rails 3.1.3

I was having a heck of a time getting this to work, and still am. I'll get to the heart of it. I'm following Ryan Bates tutorial to make cropping work using Jcrop and Carrierwave. I've opted to use MiniMagick because even after reinstalling…
counterbeing
  • 2,721
  • 2
  • 27
  • 47
17
votes
5 answers

Reprocessing images of different versions in Carrierwave

Using Carrierwave, I created 3 versions of an avatar - an original, a small_thumb and a large_thumb using the following lines: process :resize_to_limit => [400, 400] version :big_thumb do process :resize_to_limit => [80, 80] end …
Jonathan Chiu
  • 1,637
  • 2
  • 16
  • 25
17
votes
2 answers

Getting PDF from WickedPDF for attachment via Carrierwave

In Rails3, I am using the WickedPDF gem to render a PDF format of one of my models. This is working fine: /invoices/123 returns HTML, /invoices/123.pdf downloads a PDF. In my Invoice model, I am using the state_machine gem to keep track of Invoice…
lascarides
  • 335
  • 3
  • 9
16
votes
1 answer

rails + carrierwave + fog + S3 socket error

I'm having this problem trying to use S3 services with fog and the Jquery File Upload (https://github.com/blueimp/jQuery-File-Upload) The error Excon::Errors::SocketError (getaddrinfo: nodename nor servname provided, or not known (SocketError)):…
Ron
  • 2,215
  • 3
  • 22
  • 30
16
votes
2 answers

Carrierwave how to get the file extension

I'm developing a Ruby on Rails application that requires file uploading/downloading. For the upload part i used the gem carrierwave since it's very easy to use and flexible. The problem is: once i uploaded the file, i need to know a few things: i.e.…
Wiggin
  • 329
  • 1
  • 3
  • 17