paperclip

Videos not uploading with Paperclip Gem - ffmpeg in Rails

十年热恋 提交于 2019-12-10 18:37:02
问题 I'm able to upload my images however, when I try to upload videos it posts as a black screen with a play button that does not work. I'm not sure where I went wrong. Do I need a video player in order for this to work? This may be an easy solution however, I'm new to Rails. Any help is greatly appreciated. Thank you. Post Model class Post < ActiveRecord::Base belongs_to :user has_attached_file :image, :styles => { :medium => "300x300>", :thumb => "100x100>" } has_attached_file :video, :styles =

Rails 3 paperclip install, now get LoadError

蓝咒 提交于 2019-12-10 17:55:23
问题 I am very new to Rails, I am running Rails 3 I recently installed ImageMagick via Homebrew and then ran 'sudo plugin install git://github.com/thoughtbot/paperclip.git' I added "gem 'rmagick'" to my root Gemfile. Immediately after doing so I found that no rails commands worked anymore (error below). I tried adding "config.gem "rmagick", :lib => "RMagick"" to my environment.rb as some other threads suggested, but this returns a different error (undefined local variable or method `config' for

Can't upload zip files using ruby on rails and paperclip gem

夙愿已清 提交于 2019-12-10 17:19:36
问题 I'm working on a rails web application. Just created and prepared some models and stuff. The application is very simple. But now I have a problem by setting up the gem paperclip to add attachments to a model. Almost everything works fine, like attaching images/jpg or even pdf. But I can't upload zip files. I tried different zip files, but I'm always getting: "Attachment Paperclip::Errors::NotIdentifiedByImageMagickError" This is my model: class Order < ActiveRecord::Base has_attached_file

Rails Paperclip S3 - missing required :bucket option

你离开我真会死。 提交于 2019-12-10 16:01:55
问题 I'm trying to use Amazon S3 for Paperclip attachments. First, I'm trying to get it to work in development environment on my iMac. I have created the Amazon buckets = ndeavor-dev and ndeavor-pro. In the code below, I have substituted the bucket name and keys. I have the gem's paperclip and aws-sdk . The error I get is: ArgumentError at /attachments missing required :bucket option I have tried this in my config/environments/development.rb: config.paperclip_defaults = { :storage => :s3, :s3

Apply processor with paperclip if condition it's true

你。 提交于 2019-12-10 15:54:22
问题 I have a model with paperclip ruby gem. I defined an attached file with 2 processors ( thumbnail and watermark ). The question is if exist the way to apply the watermark processor if condition is true . (the idea it's not define new attached_files without watermark processor) Thanks in advance. I try using this code, but dosen't works. If the field eid exist process with watermark else if null process only thumbnail :processors => lambda { |a| if a.eid.nil? [:thumbnail,:watermark] else [

How do I save images via options_for_select with Paperclip and Image Picker on Rails 4?

99封情书 提交于 2019-12-10 11:39:49
问题 I'm trying to save images via a form that populates a "Select" field with a number of options. The select form uses Image Picker to change the options when an user clicks on a selected image. When the form is submitted, the selected image should be saved with the Paperclip gem. I think I just need to point the image url from the selected option to a method that will open it in Paperclip, but I'm not quite sure how to do that. I'm new to Rails, and humbly appreciate anything that will point me

How to set up Amazon S3, paperclip, and ENV variables

一世执手 提交于 2019-12-10 10:07:41
问题 I have tried many different ways to set up S3 using ENV variables for image uploads and cannot get it to work. I know my keys and bucket name work, because when I put them straight into the code, my images upload correctly. However, when I try to switch to ENV variables, things do not work. I used the figaro gem, which created application.yml. In that file, I have: S3_BUCKET_NAME "xxxxx" AWS_ACCESS_KEY_ID: "AAAAAAAAA" AWS_SECRET_ACCESS_KEY: "BBBbbbBBBB" Not sure if there should be any

Development error using paperclip and Amazon s3

末鹿安然 提交于 2019-12-10 08:09:32
问题 I have my app running on heroku and have configured to save all assets uploaded to a bucket using Amazon s3.That all works fine. So when i tried to upload an image locally (development) i get the following error AWS::S3::Errors::PermanentRedirect in RecipesController#update The bucket you are attempting to access must be addressed using the specified endpoint. Please send all future requests to this endpoint. My update action def update @recipe = Recipe.find(params[:id]) if @recipe.update

Paperclip with S3 on Rails 3 / uninitialized constant AWS::S3::Connection

℡╲_俬逩灬. 提交于 2019-12-10 04:21:30
问题 I'm trying to upload a file to s3 using paperclip and get this error when making a new object and referencing the variable: the aws-s3 gem is installed the s3.yml file has the correct credentials ie: a = Attachment.new a.file NameError: uninitialized constant AWS::S3::Connection from /Library/Ruby/Gems/1.8/gems/aws-s3-0.6.2/lib/aws/s3/extensions.rb:206:in `const_missing' from /Library/Ruby/Gems/1.8/gems/aws-s3-0.6.2/lib/aws/s3.rb:32 from /Library/Ruby/Gems/1.8/gems/aws-s3-0.6.2/lib/aws/s3.rb

Validating attachment contents on upload with Paperclip gem

倖福魔咒の 提交于 2019-12-10 04:20:36
问题 Paperclip has validator methods for validating the presence, size, and content-type of files. But is there a way to validate the contents of the file before the record is saved? I tried doing validate :my_method and opening the file from [attachment].path in my_method , but of course that fails because the attachment hasn't been moved to its final resting place in the file system before the record is saved. Writing a custom Paperclip post-processor seemed like an option because it has access