Search Results

Search found 152 results on 7 pages for 'paperclip'.

Page 1/7 | 1 2 3 4 5 6 7  | Next Page >

  • Paperclip: delete attachment and "can't convert nil into String" error

    - by snitko
    I'm using Paperclip and here's what I do in the model to delete attachments: def before_save self.avatar = nil if @delete_avatar == 1.to_s end Works fine unless @delete_avatar flag is set when the user is actually uploading the image (so the model receives both params[:user][:avatar] and params[:user][:delete_avatar]. This results in the following error: TypeError: can't convert nil into String from /Work/project/src/vendor/plugins/paperclip/lib/paperclip/storage.rb:40:in `dirname' from /Work/project/src/vendor/plugins/paperclip/lib/paperclip/storage.rb:40:in `flush_writes' from /Work/project/src/vendor/plugins/paperclip/lib/paperclip/storage.rb:38:in `each' from /Work/project/src/vendor/plugins/paperclip/lib/paperclip/storage.rb:38:in `flush_writes' from /Work/project/src/vendor/plugins/paperclip/lib/paperclip/attachment.rb:144:in `save' from /Work/project/src/vendor/plugins/paperclip/lib/paperclip/attachment.rb:162:in `destroy' from /Work/project/src/app/models/user.rb:72:in `before_save' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/callbacks.rb:347:in `send' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/callbacks.rb:347:in `callback' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/callbacks.rb:249:in `create_or_update' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/base.rb:2538:in `save_without_validation' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/validations.rb:1078:in `save_without_dirty' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/dirty.rb:79:in `save_without_transactions' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/transactions.rb:229:in `send' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/transactions.rb:229:in `with_transaction_returning_status' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/database_statements.rb:136:in `transaction' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/transactions.rb:182:in `transaction' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/transactions.rb:228:in `with_transaction_returning_status' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/transactions.rb:196:in `save' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/transactions.rb:208:in `rollback_active_record_state!' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/transactions.rb:196:in `save' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/base.rb:723:in `create' I assume it has something to do with the avatar.dirty? value because when it certainly is true when this happens. The question is, how do I totally reset the thing if there are changes to be saved and abort avatar upload when the flag is set?

    Read the article

  • Paperclip: delete attachments and "can't convert nil into String" error

    - by snitko
    I'm using Paperclip and here's what I do in the model to delete attachments: def before_save self.avatar = nil if @delete_avatar == 1.to_s end Works fine unless @delete_avatar flag is set when the user is actually uploading the image (so the model receives both params[:user][:avatar] and params[:user][:delete_avatar]. This results in the following error: TypeError: can't convert nil into String from /Work/project/src/vendor/plugins/paperclip/lib/paperclip/storage.rb:40:in `dirname' from /Work/project/src/vendor/plugins/paperclip/lib/paperclip/storage.rb:40:in `flush_writes' from /Work/project/src/vendor/plugins/paperclip/lib/paperclip/storage.rb:38:in `each' from /Work/project/src/vendor/plugins/paperclip/lib/paperclip/storage.rb:38:in `flush_writes' from /Work/project/src/vendor/plugins/paperclip/lib/paperclip/attachment.rb:144:in `save' from /Work/project/src/vendor/plugins/paperclip/lib/paperclip/attachment.rb:162:in `destroy' from /Work/project/src/app/models/user.rb:72:in `before_save' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/callbacks.rb:347:in `send' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/callbacks.rb:347:in `callback' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/callbacks.rb:249:in `create_or_update' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/base.rb:2538:in `save_without_validation' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/validations.rb:1078:in `save_without_dirty' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/dirty.rb:79:in `save_without_transactions' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/transactions.rb:229:in `send' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/transactions.rb:229:in `with_transaction_returning_status' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/connection_adapters/abstract/database_statements.rb:136:in `transaction' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/transactions.rb:182:in `transaction' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/transactions.rb:228:in `with_transaction_returning_status' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/transactions.rb:196:in `save' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/transactions.rb:208:in `rollback_active_record_state!' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/transactions.rb:196:in `save' from /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/base.rb:723:in `create' I assume it has something to do with the avatar.dirty? value because when it certainly is true when this happens. The question is, how do I totally reset the thing if there are changes to be saved and abort avatar upload when the flag is set?

    Read the article

  • Paperclip - Stream not recognized by identify command

    - by user117046
    I'm getting a paperclip error every time that I upload an image: [paperclip] An error was received while processing: #<Paperclip::NotIdentifiedByImageMagickError: /tmp/stream20100531-1921-uvlewk-0 is not recognized by the 'identify' command.> I'm running: Ubuntu 10.04, Imagemagick 6.5.1-0 (via apt-get), Paperclip 3.2.1.1 My path to identify is 'usr/bin/identify' and have confirmed Imagemagick works via command line I've tried putting adding the path to the options, but to no avail. I've tried: Paperclip.options[:command_path] = "usr/bin" or Paperclip.options.merge!(:command_path => "/usr/bin") in environment.rb or config/initializers/paperclip.rb. Though it makes no rational sense, I also tried "usr/local/bin" since this is the default for most people. Any thoughts on getting around this? Thanks!

    Read the article

  • Rails3 and Paperclip

    - by arkannia
    Hi, I have migrated my application from rails 2.3 to rails3 and i have a problem with paperclip. I saw there was a branch for rails3 on paperclip git. So I added "gem 'paperclip', :git = 'git://github.com/thoughtbot/paperclip.git', :branch = 'rails3'" into the Gemfile and launch the command bundle install. Once paperclip installed, the upload worked fine but not the styles. I saw a hack to fix it. # in lib/paperclip/attachment.rb at line 293 def callback which #:nodoc: # replace this line... # instance.run_callbacks(which, @queued_for_write){|result,obj| result == false } # with this: instance.run_callbacks(which, @queued_for_write) end The styles are ok after that, but i'm not able to active the processor. My code is : has_attached_file :image, :default_url => "/images/nopicture.jpg", :styles => { :large => "800x600>", :cropped => Proc.new { |instance| "#{instance.width}x#{instance.height}>" }, :crop => "300x300>" }, :processors => [:cropper] My processor is located in RAILS_APP/lib/paperclip_processors/cropper.rb and contains : module Paperclip class Cropper < Thumbnail def transformation_command if crop_command and !skip_crop? crop_command + super.sub(/ -crop \S+/, '') else super end end def crop_command target = @attachment.instance trans = ""; trans << " -crop #{target.crop_w}x#{target.crop_h}+#{target.crop_x}+#{target.crop_y}" if target.cropping? trans << " -resize \"#{target.width}x#{target.height}\"" trans end def skip_crop? ["800x600>", "300x300>"].include?(@target_geometry.to_s) end end end My problem is that i got this error message : uninitialized constant Paperclip::Cropper The cropped processor is not loaded. Is anybody has an idea to fix that ? For information my application works fine on rails 2.3.4.

    Read the article

  • rmagick error on heroku

    - by nvano
    i'm cropping images with paperclip. i have a custom module which works great on my local machine (copied from railscast 182). //file: lib/paperclip_processors/cropper.rb module Paperclip class Cropper < Thumbnail def transformation_command if crop_command crop_command + super.sub(/ -crop \S+/, '') else super end end def crop_command target = @attachment.instance if target.cropping? " -crop '#{target.crop_w.to_i}x#{target.crop_h.to_i}+#{target.crop_x.to_i}+# {target.crop_y.to_i}'" end end end end on heroku i get the following error: NoMethodError (private method `sub' called for ["-resize", "220x", "-crop", "220x220+0+18", "+repage"]:Array): lib/paperclip_processors/cropper.rb:12:in `transformation_command' paperclip (2.3.3) lib/paperclip/thumbnail.rb:55:in `make' paperclip (2.3.3) lib/paperclip/processor.rb:33:in `make' paperclip (2.3.3) lib/paperclip/attachment.rb:295:in `post_process_styles' paperclip (2.3.3) lib/paperclip/attachment.rb:294:in `each' paperclip (2.3.3) lib/paperclip/attachment.rb:294:in `inject' paperclip (2.3.3) lib/paperclip/attachment.rb:294:in `post_process_styles' paperclip (2.3.3) lib/paperclip/attachment.rb:291:in `each' paperclip (2.3.3) lib/paperclip/attachment.rb:291:in `post_process_styles' paperclip (2.3.3) lib/paperclip/attachment.rb:285:in `post_process' paperclip (2.3.3) lib/paperclip/callback_compatability.rb:23:in `call' paperclip (2.3.3) lib/paperclip/callback_compatability.rb:23:in `run_paperclip_callbacks' paperclip (2.3.3) lib/paperclip/attachment.rb:284:in `post_process' paperclip (2.3.3) lib/paperclip/callback_compatability.rb:23:in `call' paperclip (2.3.3) lib/paperclip/callback_compatability.rb:23:in `run_paperclip_callbacks' paperclip (2.3.3) lib/paperclip/attachment.rb:283:in `post_process' paperclip (2.3.3) lib/paperclip/attachment.rb:214:in `reprocess!' app/models/user.rb:339:in `reprocess_avatar' app/controllers/user_controller.rb:57:in `update_avatar' haml (2.2.3) rails/./lib/sass/plugin/rails.rb:19:in `process' /home/heroku_rack/lib/static_assets.rb:9:in `call' /home/heroku_rack/lib/last_access.rb:25:in `call' /home/heroku_rack/lib/date_header.rb:14:in `call' thin (1.0.1) lib/thin/connection.rb:80:in `pre_process' thin (1.0.1) lib/thin/connection.rb:78:in `catch' thin (1.0.1) lib/thin/connection.rb:78:in `pre_process' thin (1.0.1) lib/thin/connection.rb:57:in `process' thin (1.0.1) lib/thin/connection.rb:42:in `receive_data' eventmachine (0.12.6) lib/eventmachine.rb:240:in `run_machine' eventmachine (0.12.6) lib/eventmachine.rb:240:in `run' thin (1.0.1) lib/thin/backends/base.rb:57:in `start' thin (1.0.1) lib/thin/server.rb:150:in `start' thin (1.0.1) lib/thin/controllers/controller.rb:80:in `start' thin (1.0.1) lib/thin/runner.rb:173:in `send' thin (1.0.1) lib/thin/runner.rb:173:in `run_command' thin (1.0.1) lib/thin/runner.rb:139:in `run!' thin (1.0.1) bin/thin:6 /usr/local/bin/thin:20:in `load' /usr/local/bin/thin:20

    Read the article

  • WYSIHAT Photos upload not working - Paperclip - Ruby on Rails

    - by bgadoci
    I just successfully installed WysiHat in my rails blog. Seems that the 'add a picture' feature is not working. It successfully allows me to find and select a picture from my desktop but upon clicking save, it does nothing. I also have Paperclip successfully installed. I am wondering if this may have something to do with it. Perhaps Paperclip is getting in the way, or, perhaps I need to connect Paperclip and WysiHat somehow. Any ideas? (let me know if I need to post any code). Also, WysiHat-engine uses facebox, not sure if that is relevant. UPDATE: Added Server Log, looks like paperclip is saving it so not sure what else is going wrong. Processing PostsController#update (for 127.0.0.1 at 2010-04-23 16:42:14) [PUT] Parameters: {"commit"=>"Update", "post"=>{"body"=>"<p>Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.</p>", "title"=>"Rails Code for Search"}, "authenticity_token"=>"hndm6pxaPLfgnSMFAmLDGNo86mZG3XnlfJoNOI/P+O8=", "id"=>"105"} Post Load (0.2ms) SELECT * FROM "posts" WHERE ("posts"."id" = 105) Post Update (0.3ms) UPDATE "posts" SET "updated_at" = '2010-04-23 21:42:14', "body" = '<p>Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi. Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.</p>' WHERE "id" = 105 [paperclip] Saving attachments. Redirected to http://localhost:3000/posts/105 Completed in 12ms (DB: 0) | 302 Found [http://localhost/posts/105]

    Read the article

  • Error processing Spree sample images - file not recognized by identify command in paperclip geometry.rb:29

    - by purpletonic
    I'm getting an error when I run the Spree sample data. It occurs when Spree tries to load in the product data, specifically the product images. Here's the error I'm getting: * Execute db:load_file loading ruby <GEM DIR>/sample/lib/tasks/../../db/sample/spree/products.rb -- Processing image: ror_tote.jpeg rake aborted! /var/folders/91/63kgbtds2czgp0skw3f8190r0000gn/T/ror_tote.jpeg20121007-21549-2rktq1 is not recognized by the 'identify' command. <GEM DIR>/paperclip-2.7.1/lib/paperclip/geometry.rb:31:in `from_file' <GEM DIR>/spree/core/app/models/spree/image.rb:35:in `find_dimensions' I've made sure ImageMagick is installed correctly, as previously I was having problems with it. Here's the output I'm getting when running the identify command directly. $ identify Version: ImageMagick 6.7.7-6 2012-10-06 Q16 http://www.imagemagick.org Copyright: Copyright (C) 1999-2012 ImageMagick Studio LLC Features: OpenCL ... other usage info omitted ... I also used pry with the pry-debugger and put a breakpoint in geometry.rb inside of Paperclip. Here's what that section of geometry.rb looks like: # Uses ImageMagick to determing the dimensions of a file, passed in as either a # File or path. # NOTE: (race cond) Do not reassign the 'file' variable inside this method as it is likely to be # a Tempfile object, which would be eligible for file deletion when no longer referenced. def self.from_file file file_path = file.respond_to?(:path) ? file.path : file raise(Errors::NotIdentifiedByImageMagickError.new("Cannot find the geometry of a file with a blank name")) if file_path.blank? geometry = begin silence_stream(STDERR) do binding.pry Paperclip.run("identify", "-format %wx%h :file", :file => "#{file_path}[0]") end rescue Cocaine::ExitStatusError "" rescue Cocaine::CommandNotFoundError => e raise Errors::CommandNotFoundError.new("Could not run the `identify` command. Please install ImageMagick.") end parse(geometry) || raise(Errors::NotIdentifiedByImageMagickError.new("#{file_path} is not recognized by the 'identify' command.")) end At the point of my binding.pry statement, the file_path variable is set to the following: file_path => "/var/folders/91/63kgbtds2czgp0skw3f8190r0000gn/T/ror_tote.jpeg20121007-22732-1ctl1g1" I've also double checked that this exists, by opening my finder in this directory, and opened it with preview app; and also that the program can run identify by running %x{identify} in pry, and I receive the same version Version: ImageMagick 6.7.7-6 2012-10-06 Q16 as before. Removing the additional digits (is this a timestamp?) after the file extension and running the Paperclip.run command manually in Pry gives me a different error: Cocaine::ExitStatusError: Command 'identify -format %wx%h :file' returned 1. Expected 0 I've also tried manually updating the Paperclip gem in Spree to 3.0.2 and still get the same error. So, I'm not really sure what else to try. Is there still something incorrect with my ImageMagick setup?

    Read the article

  • paperclip overwrites / resets S3 permissions for non-bucket-owners

    - by adriandz
    I have opened this as an issue on Github (http://github.com/thoughtbot/paperclip/issues/issue/225) but on the chance that I'm just doing this wrong, I thought I'd also ask about it here. If someone can tell me where I'm going wrong, I can close the issue and save the Paperclip guys some trouble. Issue: When using S3 for storage, and you wish your bucket to allow access to other users to whom you have granted access, Paperclip appears to overwrite the permissions on the bucket, removing access to these users. Process for duplication: Create a bucket in S3 and set up a Rails app with Paperclip to use this bucket for storage Add a user (for example, [email protected], the user for the video encoding service Zencoder) to the bucket, and grant this user List and Read/Write permissions. Upload a file. Refresh the permissions. The user you added will be gone. As well, a user "Everyone" with read permissions will have been added. The end result is that you cannot, so far as I can tell, retain desired permissions on your bucket when using Paperclip and S3. Can anyone help?

    Read the article

  • Problem w/ Paperclip, MacPorts, ImageMagick & Snow Leopard

    - by Kyle Decot
    I'm attempting to use ImageMagick along w/ Paperclip to handle the images on my rails app. The problem is whenever I try to upload an image I get the following in the terminal: [paperclip] An error was received while processing: #<Paperclip::NotIdentifiedByImageMagickError: /var/folders/go/goZ833AaFaqyvv5RnLqQmE+++TM/-Tmp-/stream20110107-6356-1xfs9j1-0.jpg is not recognized by the 'identify' command.> I have added the following to my environments/development.rb file: Paperclip.options[:command_path] = "/usr/local/bin" If I try to interact w/ ImageMagick in the terminal by using "convert" or something similar I get: dyld: Library not loaded: /opt/local/lib/libltdl.7.dylib Referenced from: /usr/local/bin/convert Reason: Incompatible library version: convert requires version 10.0.0 or later, but libltdl.7.dylib provides version 9.0.0 Trace/BPT trap I've already tried updating everything w/ port but the problem still persists. Does anyone have any ideas or suggestions?

    Read the article

  • Installing paperclip plugin

    - by mnml
    I'm trying to install the paperclip plugin with the following command: ruby script/plugin install git://github.com/thoughtbot/paperclip.git But I'm getting some errors: ruby script/plugin install git://github.com/thoughtbot/paperclip.git --force svn: '/home/app/vendor/plugins' is not a working copy /usr/lib/ruby/1.8/open-uri.rb:32:in `initialize': No such file or directory - git://github.com/thoughtbot/paperclip.git (Errno::ENOENT) from /usr/lib/ruby/1.8/open-uri.rb:32:in `open_uri_original_open' from /usr/lib/ruby/1.8/open-uri.rb:32:in `open' from ./script/../config/../vendor/rails/railties/lib/commands/plugin.rb:863:in `fetch_dir' from ./script/../config/../vendor/rails/railties/lib/commands/plugin.rb:857:in `fetch' from ./script/../config/../vendor/rails/railties/lib/commands/plugin.rb:856:in `each' from ./script/../config/../vendor/rails/railties/lib/commands/plugin.rb:856:in `fetch' from ./script/../config/../vendor/rails/railties/lib/commands/plugin.rb:219:in `install_using_http' from ./script/../config/../vendor/rails/railties/lib/commands/plugin.rb:169:in `send' from ./script/../config/../vendor/rails/railties/lib/commands/plugin.rb:169:in `install' from ./script/../config/../vendor/rails/railties/lib/commands/plugin.rb:734:in `parse!' from ./script/../config/../vendor/rails/railties/lib/commands/plugin.rb:732:in `each' from ./script/../config/../vendor/rails/railties/lib/commands/plugin.rb:732:in `parse!' from ./script/../config/../vendor/rails/railties/lib/commands/plugin.rb:447:in `parse!' from ./script/../config/../vendor/rails/railties/lib/commands/plugin.rb:463:in `parse!' from ./script/../config/../vendor/rails/railties/lib/commands/plugin.rb:871 from script/plugin:3:in `require' from script/plugin:3 Is it because I'm using a old rails version?

    Read the article

  • paperclip error

    - by ZX12R
    i am trying paperclip for the first time and followed this tutorial all is well until i use styles. this is the code has_attached_file :photo, :url => "/uploads/products/:id/:style/:basename.:extension", :path => ":rails_root/public/uploads/products/:id/:style/:basename.:extension", :styles => { :thumb=> "100x100#" } the error i see on the console is [paperclip] An error was received while processing: #<Paperclip::NotIdentifiedByImageMagickError: C:/DOCUME~1/LOCALS~1/Temp/stream,2956,1.jpg is not recognized by the 'identify' command.> what does this mean? I have no idea what it means. Should i install this ImageMagick? I tried installing it as a plugin as per this page. This also returns an error that "plugin not found". what am i missing here?

    Read the article

  • How to get paperclip to delete files

    - by webdestroya
    I have a model that is using Paperclip to manage the file. After I delete the model, I obviously would like the file to be deleted as well, but I cannot seem to find out how to get the file deleted using Paperclip. I have tried self.sourcefile = nil if !sourcefile.dirty? in the before_destroy def, but that had no effect. (I want to be able to have it delete the file locally when I test, and then on S3 when I use that - So i need a pure paperclip solution) Any ideas?

    Read the article

  • Paperclip plugin on Rails 3

    - by Jiang
    Hi all, I tried to use paperclip plugin on rails 3-beta 3. I installed this plugin successfully, but when I use the following script to generate: rails generate paperclip xxx xxx it said generator not found. Any ideas? Thanks.

    Read the article

  • Heroku- Could not find paperclip-3.1.3 in any of the sources

    - by otchkcom
    This morning when I tried to update my website, heroku didn't let me push the app. Here's the message I got. Fetching gem metadata from http://rubygems.org/....... Fetching gem metadata from http://rubygems.org/.. Fetching git://github.com/drhenner/nifty-generators.git Could not find paperclip-3.1.3 in any of the sources ! ! Failed to install gems via Bundler. ! ! Heroku push rejected, failed to compile Ruby/rails app ! [remote rejected] master -> master (pre-receive hook declined) I don't have paperclip- 3.1.3 in my gem file. I'm not sure why it's looking for paperclip 3.1.3 Here's my gem file source 'http://rubygems.org' gem 'rails', '~> 3.2.6' gem 'asset_sync' group :assets do gem 'uglifier', '>= 1.0.3' end gem 'sass-rails', " ~> 3.2.3" gem "activemerchant", '~> 1.17.0' #, :lib => 'active_merchant' gem 'authlogic', "3.0.3" gem 'bluecloth', '~> 2.1.0' gem 'cancan', '~> 1.6.7' gem 'compass', '~> 0.12.rc.0' gem 'compass-rails' gem 'dalli', '~> 1.1.5' gem "friendly_id", "~> 3.3" gem 'haml', ">= 3.0.13"#, ">= 3.0.4"#, "2.2.21"#, gem "jquery-rails" gem 'aws-sdk' group :production do gem 'pg' gem 'thin' end gem 'nested_set', '~> 1.6.3' gem 'nokogiri', '~> 1.5.0' gem 'paperclip', '~> 3.0' gem 'prawn', '~> 0.12.0' gem 'rails3-generators', '~> 0.17.0' gem 'rmagick', :require => 'RMagick' gem 'rake', '~> 0.9.2' gem 'state_machine', '~> 1.1.2' gem 'sunspot_solr' gem 'sunspot_rails', '~> 1.3.0rc' gem 'will_paginate', '~> 3.0.0' gem 'dynamic_form' group :development do gem 'sqlite3' gem "autotest-rails-pure" gem "rails-erd" gem "ruby-debug19" end group :test, :development do gem "rspec-rails", "~> 2.8.0" gem 'capybara', :git => 'git://github.com/jnicklas/capybara.git' gem 'launchy' gem 'database_cleaner' end group :test do gem 'factory_girl', "~> 3.3.0" gem 'factory_girl_rails', "~> 3.3.0" gem 'mocha', '~> 0.10.0', :require => false gem 'rspec-rails-mocha' gem "rspec", "~> 2.8.0" gem "rspec-core", "~> 2.8.0" gem "rspec-expectations", "~> 2.8.0" gem "rspec-mocks", "~> 2.8.0" gem 'email_spec' gem "faker" gem "autotest", '~> 4.4.6' gem "autotest-rails-pure" gem "autotest-growl" gem "ZenTest", '4.6.2' end

    Read the article

  • rails 3 paperclip imagemagick problem

    - by user311686
    I have been trying to get paperclip working for a few days now with no luck! From what I am aware this error below is related to imagemagick. I have tried to uninstall and install imagemagick both with macports and manually. Also, have Paperclip.options[:command_path] = "/usr/local/bin" set. It's starting to drive me nuts! Photo /var/folders/A7/A7X8PAnOFsCTHkFpeODoO++++TI/-Tmp-/stream,65411,0.jpeg is not recognized by the 'identify' command.

    Read the article

  • paperclip private files

    - by Dmitriy Likhten
    Is there a way to make paperclip attachments private? As in only where I explicitly want a user to be able to access a file, can the user access the file. Obviously the file can't be in a public directory, but how do I get paperclip to check the user's access rights when trying to access that file to begin with?

    Read the article

  • Paperclip wont save image in rails app

    - by Micke
    Hello stackoverflow. I am trying to use Paperclip with my rails app to add an avatar to a user but it wont save my image when creating the user. This is what the model looks like: class User < ActiveRecord::Base has_attached_file :avatar And the registerform in haml: - form_for :user, @user, :url => { :action => "signup" }, :html => { :multipart => true } do |f| ... ... %li %div{:class => "header"} Profilepicture %div{:class => "input"} = f.file_field :avatar And when i look in the log this is what is being passet to the "signup" action: Parameters: {"commit"=>"Save", "action"=>"signup", "controller"=>"user/register", "user"=>{"name"=>"Micke Lisinge", "birthmonth"=>"07", "password_confirmation"=>"[FILTERED]", "nickname"=>"lisinge", "avatar"=>#<File:/tmp/RackMultipart20100426-3076-1x04oxy-0>, "gen"=>"m", "birthday"=>"23", "password"=>"[FILTERED]", "birthyear"=>"1992", "email"=>"[email protected]"}} [paperclip] Saving attachments. Paperclip says it is saving the template but when i look in the public folder in my app it has created a system but the system folder is empty. So it seems like it isnt saving the picture to the folder. It gets handled by the form and saved in my /tmp folder. Maybe you guys have any tips or know what this problem might be? Thanks in advance, Micke.

    Read the article

  • Shoulda and Paperclip testing

    - by trobrock
    I am trying to test a couple models that have an attachment with Paperclip. I have all of my validations passing except for the content-type check. # myapp/test/unit/project_test.rb should_have_attached_file :logo should_validate_attachment_presence :logo should validate_attachment_size(:logo).less_than(1.megabyte) should_validate_attachment_content_type :logo, :valid => ["image/png", "image/jpeg", "image/pjpeg", "image/x-png"] # myapp/app/models/project.rb has_attached_file :logo, :styles => { :small => "100x100>", :medium => "200x200>" } validates_attachment_presence :logo validates_attachment_size :logo, :less_than => 1.megabyte validates_attachment_content_type :logo, :content_type => ["image/png", "image/jpeg", "image/pjpeg", "image/x-png"] The errors I am getting: 1) Failure: test: Client should validate the content types allowed on attachment logo. (ClientTest) [/Library/Ruby/Gems/1.8/gems/thoughtbot-shoulda-2.10.2/lib/shoulda/assertions.rb:55:in `assert_accepts' vendor/plugins/paperclip/shoulda_macros/paperclip.rb:44:in `__bind_1276100387_499280' /Library/Ruby/Gems/1.8/gems/thoughtbot-shoulda-2.10.2/lib/shoulda/context.rb:351:in `call' /Library/Ruby/Gems/1.8/gems/thoughtbot-shoulda-2.10.2/lib/shoulda/context.rb:351:in `test: Client should validate the content types allowed on attachment logo. ']: Content types image/png, image/jpeg, image/pjpeg, image/x-png should be accepted and rejected by logo This happens on two different models that are set up the same way.

    Read the article

  • Paperclip failing to upload on specific scaffold, yet works on others

    - by Saifis
    I know there are tons of questions about paperclip, but I failed to find the answer to my problem. I know its prob just something simple, but I I'm running out of hair to pull out. I have paperclip working on other parts of my project, they work with no problem, however, a certain scaffold fails to upload, all the attributes to the uploaded file are nil. Here are the relevant information. Model: has_attached_file :foo, :styles => { :thumb => "140x140>" }, :url => "/data/:id/:style/:basename.:extension", :path => ":rails_root/public/data/:id/:style/:basename.:extension" View: <% form_for(@bar, :html => { :multipart => true }) do |f| %> <%= f.error_messages %> ---------- <li><%= f.label :top %> <%= f.file_field :foo %></li> ---------- <ul><%= f.submit "Save" %></ul> <% end %> Also, comparing the logs to the parts that work, the :foo attribute seems to be passing different values than in the ones that work. In the logs, when the paperclip function works, it looks like this "image"=>#<File:/var/folders/M5/M5HEb+WhFxmqNDGH5s-pNE+++TI/-Tmp-/RackMultipart20100512-1302-5e2e6e-0> when it does not, it seems to pass the file name directly "foo"=>"foo_image.png" I am developing locally on MacOSX using local rails and ruby libs.

    Read the article

  • Using rest-client to upload a paperclip attachment but getting no file found error

    - by Angela
    Hello, I have a paperclip attachment that I wan to upload to a web-service using rest-client. However, when I try to run it, I get an error: No such file or directory - /system/postalimages/1/original/postcard-1.png?1274635084 But the file exists for sure: I see it in my directory. How do I debug this? Here is the code in my controller which makes the upload: def upload @postalcard = Postalcard.find(:last) response = RestClient.post('http://www.postful.com/service/upload', { :upload => { :file => File.new(@postalcard.postalimage.url,'rb') #paperclip file path } }, #end payload {"Content-Type" => @postalcard.postalimage.content_type, "Content-Length" => @postalcard.postalimage.size, "Authorization" => 'Basic dGltZm9uZzg4OEBnbWFpbC5jb206ZDlQcTVKUU4='} # end headers ) #close arguments to Restclient.post return response.body end

    Read the article

  • Conditional Validation with Paperclip difficult

    - by Michael Schmitz
    Hi, I have an "item", which goes through a multi-page creation process. Images are uploaded at step five, and I keep track of the steps by using the attribute "complete". When validating whether an image is attached with paperclip, I get problems using the code below: validates_attachment_presence :pic1, :if => Proc.new { |u| u.complete == "step5"} It seems that I can't access the "complete" attribute, as the active-record object seems to be the paperclip image. Is there a way for me to check at which point in the process I am and validate conditionally? Thanks, Michael

    Read the article

  • How to get image capture date and video duration when uploading files using SWFUpload and Paperclip

    - by Hatem
    Hi Guys, I'm using SWFUpload and Paperclip on Rails 2.3.5 to upload images and videos. How can I store the capture date of images and duration of videos? The following works correctly in irb: irb(main):001:0> File.new('hatem.jpg').mtime => Tue Mar 09 16:56:38 +0200 2010 But when I try to use Paperclip's before_post_process: before_post_process :get_file_info def get_file_info puts File.new(self.media.to_file.path).mtime # =>Wed Apr 14 18:36:22 +0200 2010 end I get the current date instead of the capture date. How can I fix this? Also, how can I get the video duration and store it with the model? Thank you.

    Read the article

  • paperclip callbacks or simple processor?

    - by holden
    I wanted to run the callback after_post_process but it doesn't seem to work in Rails 3.0.1 using Paperclip 2.3.8. It gives an error: undefined method `_post_process_callbacks' for #<Class:0x102d55ea0> I want to call the Panda API after the file has been uploaded. I would have created my own processor for this, but as Panda handles the processing, and it can upload the files as well, and queue itself for an undetermined duration I thought a callback would do fine. But the callbacks don't seem to work in Rails3. after_post_process :panda_create def panda_create video = Panda::Video.create(:source_url => mp3.url.gsub(/[?]\d*/,''), :profiles => "f4475446032025d7216226ad8987f8e9", :path_format => "blah/1234") end I tried require and include for paperclip in my model but it didn't seem to matter. Anyideas?

    Read the article

1 2 3 4 5 6 7  | Next Page >