Note that there are some explanatory texts on larger screens.

plurals
  1. PONoHandlerError with Rails3 and Paperclip
    primarykey
    data
    text
    <p>So this is my first question on StackOverflow. </p> <p>I'm trying to implement Paperclip on Rails 3.2.3, and after clicking "submit" to create a profile with an uploaded image, I get:</p> <blockquote> <p>Paperclip::AdapterRegistry::NoHandlerError in UsersController#update</p> <p>No handler found for "Screen Shot 2012-09-01 at 11.03.43 AM.png"</p> </blockquote> <p>My server log reads,</p> <blockquote> <p>Paperclip::AdapterRegistry::NoHandlerError (No handler found for "Screen Shot 2012-09-01 at 11.03.43 AM.png"): app/controllers/users_controller.rb:65:in <code>block in update' app/controllers/users_controller.rb:64:in</code>update'</p> </blockquote> <p>In my User model, I have</p> <pre><code>attr_accessible :avatar has_attached_file :avatar, :styles =&gt; { :large =&gt; "500x500&gt;", :medium =&gt; "213x213&gt;", # profile image :thumb =&gt; "50x50&gt;", :smaller =&gt; "30x30&gt;" }, :processors =&gt; [:cropper], # tells paperclip how to crop the image :storage =&gt; :s3, :s3_credentials =&gt; "#{Rails.root}/config/s3.yml", # TODO :path =&gt; ":attachment/:id/:style/:basename.:extension", :bucket =&gt; 'eventsbucket' </code></pre> <p>The error persists whether I include the S3 info or not. In my migration I have,</p> <pre><code>class AddAvatarColumnsToUsers &lt; ActiveRecord::Migration def self.up add_attachment :users, :avatar end def self.down remove_attachment :users, :avatar end end </code></pre> <p>Lastly, in my Users controller update action, I have</p> <pre><code>def update respond_to do |format| if @user.update_attributes(params[:user]) sign_in @user format.html { redirect_to @user, notice: 'Profile Successfully Updated' } format.json { head :no_content } else format.html { render action: "edit" } format.json { render json: @user.errors, status: :unprocessable_entity } end end end </code></pre> <p>In my Gemfile I have gem "paperclip", "~> 3.1.4" (UPDATE: I've since pulled Paperclip straight from thoughtbot and problem persists). I've run bundle install. I've run db:migrate. I've read <a href="https://stackoverflow.com/questions/10033425/paperclip-exception-paperclipadapterregistrynohandlererror">this StackOverflow entry</a>, but the error persists whether I include "multipart => true" or not. When I tried the <a href="http://emersonlackey.com/screencasts/rails-3-with-paperclip.mov" rel="nofollow noreferrer">Emerson Lackey Tutorial</a>, it worked up to the point where he tried to display the output of the "5.times..." command.</p> <p>I'm interested in both getting Paperclip to work and understanding just what a "NoHandlerError" is and how to avoid it in the future.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload