paperclip

uninitialized constant AWS::S3::NoSuchBucket

空扰寡人 提交于 2019-12-11 13:08:49
问题 I am using Rails 3 with the following code... config.gem "aws-s3", :version => ">= 0.6.2", :lib => "aws/s3" config.gem 'right_aws', :version => '2.0.0' model.rb has_attached_file :video, :storage => :s3, :s3_credentials => "#{::Rails.root.to_s}/config/s3.yml", :path => ":attachment/:id/:style/:basename.:extension" # Paperclip Validations validates_attachment_presence :video validates_attachment_content_type :video, :content_type => ['application/x-shockwave-flash', 'application/x-shockwave

'No route matches' with paperclip and S3 on Heroku

谁都会走 提交于 2019-12-11 12:58:15
问题 Setting up paperclip to use S3 on my local dev system was a snap. However, I am not able to get it to work on Heroku. The file uploads successfully: [paperclip] Saving attachments. [paperclip] saving photos/2/small.jpg [paperclip] saving photos/2/original.jpg However, views that try to link to the upload get a routing error: ActionController::RoutingError (No route matches "/photos/small/missing.png" with {:method=>:get}): Notice how it is using 'missing' for the file name and is using '.png'

Capistrano Deleting Paperclip Images

烂漫一生 提交于 2019-12-11 12:07:13
问题 For some reason Capistrano deletes all the images in my database every time I cap all the images get removed from all the users. Typically what I have done is have to refill the databased with the same images that had been delete by capistrano. I've attached my deploy.rb file, can someone give me some insight. require "bundler/capistrano" set :rvm_ruby_string, '1.9.3p429' set :rvm_type, :user set :user, "" set :password, "" set :domain, "" set :applicationdir, "" set :scm, :git set

Rails Paperclip and AJAX form

我只是一个虾纸丫 提交于 2019-12-11 11:26:53
问题 I have a modal containing a form, in which the user can upload a photo. Once the photo is correctly uploaded I want to respond via Ajax and display a message. Unfortunately the form is subbmitted in HTML and Not in JS. Any idea? Form code: <%= form_for(Object.new() , :url => {:controller => 'objects', :action => 'create'}, :remote=> true, :html => { :multipart => true }) do |f| %> <%= f.file_field :photo, label: 'add a photo' %> <%= button_tag(type: 'submit', class: "btn btn-success") do %>

Paperclip sharpening processor causes resizing styles not to work

只谈情不闲聊 提交于 2019-12-11 10:36:12
问题 I'm trying to sharpen images uploaded through paperclip. The sharpen code is working but it causes the styles to not work. The code is like this: has_attached_file :photo, :styles => { :thumb => {:geometry => "100x100>"}, :medium => {:geometry => "300x300>"}, :original => {:geometry => "1024x1024>"} }, :processors => [:sharpen], :storage => :s3, :s3_credentials => "#{Rails.root}/config/s3.yml", :path => "/:style/:id/:filename" Now if I remove the processors option, the uploaded images are

Images disappear after few hours

半腔热情 提交于 2019-12-11 09:47:05
问题 I want to create little ticket system : http://ticketsystemkm.herokuapp.com/ I got posters for movies to display them on main site. When i make new movie everything works good, but after few hours images disappear. Maybe someone had similar problem and know how to solve it. 回答1: Guessing your images are user uploads via Paperclip, or something of the like, to your public folder, which is why they're disappearing. If your app doesn't receive any traffic for 15 minutes or so, the VM it lives on

Rails getting error when trying to upload images with paperclip

落爺英雄遲暮 提交于 2019-12-11 08:53:25
问题 I only started learning rails and keep running into errors that I mostly fix by searching them up. I followed the tutorial on http://guides.rubyonrails.org/getting_started.html and finished it and am now trying to upload images to got with the blog articles. But now I'm stuck with what sounds like a really simple thing to solve, uploading images using paperclip. I get errors like : undefined method `attachment' for # Here are my files: articles_controller.rb class ArticlesController <

Rails migration complains about undefined method `attachment' using paperclip

馋奶兔 提交于 2019-12-11 08:37:53
问题 Lemmie just preface this by saying I'm fairly new to Rails. Our app uses paperclip (3.2.4) to manage attachments and as usual, I generated a migration that looks something like: class AddAttachmentPhotoToPhpfoxUsers < ActiveRecord::Migration def self.up change_table :phpfox_user do |t| t.attachment :photo end end def self.down drop_attached_file :phpfox_user, :photo end end (It's called phpfox_user because we have to build on top of a legacy db) That's all great, works fine. However, we have

How to set Paperclip :default_url according User gender and asset style?

こ雲淡風輕ζ 提交于 2019-12-11 07:45:28
问题 Through this gist script I can get default url for paperclip with user gender . But I want to get :style too. Someone know how to? 回答1: Default way of doing this: #Assuming you default images are stored in app/assets/images/somedirectory has_attached_file :attachment, default_url: :some_function def some_function "somedirectory/:style/:class/#{self.gender}.png" end or using lambda: has_attached_file :attachment, default_url: lambda{|attachment| "somedirectory/:style/:class/#{attachment

paperclip image broken in rails 3.1rc4

你。 提交于 2019-12-11 07:44:24
问题 I am using rails 3.1rc4 with paperclip and i cannot upload any image file with. I keep getting this error Image D:/Users/MOBILE/AppData/Local/Temp/stream20110612-3872-y7hmme-0.jpg is not recognized by the 'identify' command. I have imagemagic installed. But it works in <= rails 3.0.8rc4. 回答1: I am not sure if this will adress your specific issue but I found this and maybe its related: https://github.com/thoughtbot/paperclip/issues/481 It states: The paperclip:refresh:metadata rake task fails