carrierwave

Capistrano and Carrierwave

我只是一个虾纸丫 提交于 2019-12-09 23:02:46
问题 I'm deploying a Ruby on Rails and NodeJS application using Capistrano. The uploads folder gets removed on every deploy. This popped up on several places but it doesn't seem to work: # Keep File Uploads task :symlink_uploads do run "ln -nfs #{shared_path}/rails/uploads #{release_path}/rails/public/uploads" end after 'deploy:update_code', 'deploy:symlink_uploads' the repo: repo: /node /rails Thanks! 回答1: Make sure you remove the existing public/uploads folder, passing -f to ln doesn't cover

How to convert a PDF into an array of images, with Carrierwave and MiniMagick (Ruby on Rails)

梦想的初衷 提交于 2019-12-09 22:40:26
问题 I'm converting uploaded PDFs into images, with one image per page. I have figured out how to generate the images using MiniMagick::Tool::Convert , but I don't know how to write the version block for the Uploader, so that I can access an array of image URLs. Here's my uploader so far: class DocumentUploader < CarrierWave::Uploader::Base include CarrierWave::MiniMagick storage :file # storage :fog def store_dir "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}" end version :jpg

Rails 3 + carrierwave + nginx = permission denied

时光怂恿深爱的人放手 提交于 2019-12-09 13:17:46
问题 I've installed carrierwave gem with rmagick. I can get it working fine if load thro WEBrick but getting 500 Internal Server Error when trying to use nginx instead. The nginx error.log says: 2011/08/14 10:06:40 [crit] 760#0: *4247 open() "/usr/local/Cellar/nginx/1.0.4/client_body_temp/0000000033" failed (13: Permission denied), client: 127.0.0.1, server: jewellery.dev, request: "POST /items/28?locale=en HTTP/1.1", host: "jewellery.dev:8080", referrer: "http://jewellery.dev:8080/items/28/edit

How can I reorganize an existing folder hierarchy with CarrierWave?

 ̄綄美尐妖づ 提交于 2019-12-09 05:30:53
问题 I am trying to move files around my S3 bucket using CarrierWave to reorganize the folder structure. I came to an existing Rails application where all images for a class are being uploaded into a folder called /uploads . This is causing problems where if two users upload different images with the same file-name, the second image overwrites the first. To solve this, I want to reorganize the folders to place each image in its own directory according to the ActiveRecord object instance. We are

Rails image upload security

拟墨画扇 提交于 2019-12-08 18:14:26
Currently, I adopt Carrierwave for users to images. However, I hardly find a solution for image security, i.e. how to set image authorisation for the uploaded images to only let certain user in the same group to view? After digging Facebook's implementation, I observe that they inject these params (oh,oe, __gda_) to the image url ?oh=924eb34394&oe=55E07&__gda__=1436393492fc8bf91e1aec5 Is there any similar implementation for carrierwave or paperclip ? Thanks I worked quite a bit with this (only with Paperclip). There is one solution that is okay, but it takes a lot of processing. If you only

Rails 4 - How to have image upload in froala editor with carrierwave?

大城市里の小女人 提交于 2019-12-08 16:53:07
问题 I'm stuck on what to do for having image upload in froala editor. I have carrierwave working for uploading images to google cloud storage for other sections of my app and now I want to have image uploads in froala editor working as well. Here is what I've done so far Post image uplaoder class PostImageUploader < CarrierWave::Uploader::Base # Choose what kind of storage to use for this uploader: storage :fog # Override the directory where uploaded files will be stored. # This is a sensible

Rails background image upload

假装没事ソ 提交于 2019-12-08 10:50:48
问题 I'm using "carrierwave" gem for uploading image files and also "carrierwave backgrounder" to process the uploading + processing the image with RMagick in the background (I use Delayed Job for this). Everything works like a charm. Except one thing - I want to upload the images and show them right under the upload form (so ,everything happens on the same page). So, basically, what happens - since the uploading and image-processing are relatively slow, by the time the page has been rendered

Carrierwave processed images not uploading to S3

拟墨画扇 提交于 2019-12-08 09:39:23
问题 I have Carrierwave uploading images just fine to S3 buckets. However if I use RMagick to process thumbnails, the files only get saved to public tmp locally. Commenting out the process method creates the original and thumb files on S3 (of course the thumb is not processed). Not sure why the processing is stopping right after writing to local tmp. Code below: class FileUploader < CarrierWave::Uploader::Base include CarrierWave::RMagick storage :fog def store_dir "uploads/#{model.class.to_s

Errno::EACCES in Controller#upload rails roo carrierwave on ubuntu

荒凉一梦 提交于 2019-12-08 08:37:22
问题 I am using roo to parse some excelx files on my rails app on ubuntu. These are uploaded with Carrierwave. Here are my actual controller lines: excelx_file = params[:excel_file] filex = MetadataUploader.new filex.store!(excelx_file) workbook = Excelx.new("#{filex.store_path}") Here are the permissions on public/uploads: drwxrwxr-x 2 pirames pirames 4096 Jun 13 14:03 metadata_ingestion drwxrwxr-x 2 pirames pirames 4096 Jun 13 14:24 tmp Here are the permission on the file: ls -l public/uploads

Carrierwave store images locally not on s3 at heroku

南楼画角 提交于 2019-12-08 07:26:42
问题 I am using carrier wave to upload images and display them in a photo-gallery. Carrier wave store files at public/uploads . But these images are not getting displayed at heroku. I found that heroku is read only and we should store files at s3. Is there any other alternatives than s3?If yes, can you please share here? 回答1: Heroku is only read only if you're on the bamboo stack (old). For cedar , they use a ephemeral writeable filesystem, which means that whilst you can upload, it gets wiped