paperclip

Errors while using paperclip in rails app

做~自己de王妃 提交于 2019-12-25 03:37:11
问题 At the moment I try to replace attachment_fu fileuploading plugin with paperclip. But there are some errors while uploading: My controller looks like this: def create add_breadcrumb 'breadcrumb.upload_file', {:action => :new} puts "BLUBBBBBBBBBBBBBBBBBBBBBBBBBBB" puts params[:upload] @upload = Upload.create(params[:upload]) @upload.lecturer_id = current_user.id if @upload.save flash[:notice] = I18n.t("flash.saved") redirect_to :action => :index else render :action => :new end end and my model

Paperclip on Windows - undefined method `split' for nil:NilClass

不打扰是莪最后的温柔 提交于 2019-12-24 23:26:34
问题 I am getting undefined method `split' for nil:NilClass when I am trying to save uploaded file @user.avatar=params[:user][:avatar] Here is the error from server log: [32mCommand[0m :: identify -format %wx%h "C:/progs/web/ror_site_1/tmp/Rus220120701-4976-1sky1nn.jpg[0]" [32mCommand[0m :: identify -format %m "C:/progs/web/ror_site_1/tmp/Rus220120701-4976-1sky1nn.jpg[0]" [32mCommand[0m :: identify -format %m "C:/progs/web/ror_site_1/tmp/Rus220120701-4976-1sky1nn.jpg[0]" [32mCommand[0m :: convert

RoR - Paperclip - How to set minimal width of an attachement

血红的双手。 提交于 2019-12-24 18:33:43
问题 my layout's requirement is to keep all thumbnails at 80px height, not higher, not smaller. In my model I set the style to :thumb=> "500x80>" , so basically almost every picture which is not too wide gets its perfect miniature with 80px height. Sometimes, however, my pictures are narrow and high, so the thumb can have unclickable dimensions of like 5x80. So I dont want to crop pictures as long as thumbnails are not getting crazy narrow, but I think I can make a little sacrifice and crop them

S3 Direct Upload doesnt upload files

让人想犯罪 __ 提交于 2019-12-24 14:36:08
问题 /config/intilializers/paperclip.rb Paperclip::Attachment.default_options[:storage] = :s3 Paperclip::Attachment.default_options[:bucket] = 'xxx' Paperclip::Attachment.default_options[:s3_permissions] = :public_read Paperclip::Attachment.default_options[:s3_credentials] = { access_key_id: 'xxx' ,secret_access_key: 'xxx'} /config/intilializers/s3_direct_upload.rb S3DirectUpload.config do |c| c.access_key_id = 'xx' # your access key id c.secret_access_key = 'xxx' c.bucket = 'xxx' # your bucket

bundle install and ruby versions?

自闭症网瘾萝莉.ら 提交于 2019-12-24 14:03:57
问题 I'm using rbenv to set the ruby version. ruby -v produces the expected 1.9.3 I can do gem install paperclip without a problem. However, when I do bundle install it says: Installing paperclip (3.1.2) Gem::InstallError: paperclip requires Ruby version >= 1.9.2. An error occured while installing paperclip (3.1.2), and Bundler cannot continue. Make sure that `gem install paperclip -v '3.1.2'` succeeds before bundling. but, ruby -v says I'm running 1.9.3. Is bundler runnign as sudo? Have anyone

Image Paperclip::Errors::NotIdentifiedByImageMagickError #Windows

╄→гoц情女王★ 提交于 2019-12-24 13:44:18
问题 I'm getting tired of this error... I tried everything that's on the internet (that I found so far) Gem gem 'paperclip', '~> 4.3', '>= 4.3.6' config/environments/development.rb Paperclip.options[:command_path] = "/c/Program Files/ImageMagick-7.0.1-Q16/" Paperclip.options[:command_path] = 'C:\Program Files (x86)\GnuWin32\bin' path for ImageMagick/convert https://gyazo.com/2e8714546606b796b63f5b64663cab31 file.exe it installed https://gyazo.com/5d0d3d5723c52e6cc812d72202ba4038 my model has

Paperclip Image not being added in mysql database

走远了吗. 提交于 2019-12-24 12:23:23
问题 I am trying to insert image in database using paperclip gem 4 but i am getting the following errors in my rails console: Processing by ArticlesController#create as HTML Parameters: {"utf8"=>"✓", "authenticity_token"=>"chZ3Zjs0OrcRirp7SNr8PhvuIenX2itoM8GzyUhSBrk=", "article"=> {"headline"=>"dlvmlmvc., c", "content"=>"kdfl;d,av,v',", "photo"=># <ActionDispatch::Http::UploadedFile:0x007ffb091f2c08 @original_filename="bigb.jpg", @content_type="image/jpeg", @headers="Content-Disposition: form-data

Rails: Paperclip with multiple placeholder images?

左心房为你撑大大i 提交于 2019-12-24 11:28:11
问题 I've been trying to experiment with having avatars for users in my app, and I've set this up where a user can upload an image using Paperclip. Paperclip has a nice default functionality where you can define a placeholder image when the user has not uploaded an image. What I'm wondering is, is there any way to create a set of placeholder images and have paperclip choose one at random when the associated record is created? IE so not all the "no avatar" icons have to be identical? Thanks! 回答1:

even small file upload stops activity on apache/rails

廉价感情. 提交于 2019-12-24 09:24:25
问题 on my rails(2.3.5) app(currently 50-70rpm, maximum response time around 0.7s), uploading even 700k file(using paperclip plugin) locks up the server for web requests for everyone for 2 minutes! (other apps on same server work normally) does anyone have a clue why that might be happening? i am using some mysql transactions which lock the database also if that might be an issue i read http://www.therailsway.com/2009/4/23/uploading-files but it couldn't be locking server for 2 minutes for a small

Key is there but I still get `fetch': key not found: “S3_BUCKET_NAME” (KeyError)

允我心安 提交于 2019-12-24 09:04:02
问题 I know there's a ton of these asked, but I've tried to follow each one with no luck. There must be some easy mistake that I am overlooking. I'm trying to set up S3 and Paperclip following the Heroku guide and set up local testing following this Words and Code guide. Every time I try to generate a db migration though I get the error: config/environments/development.rb:62:in fetch': key not found: "S3_BUCKET_NAME" (KeyError) These are my files exactly with keys replaced: development.rb config