NoHandlerError with Rails3 and a clip

So this is my first question on StackOverflow.

I try to implement the “Clip on Rails 3.2.3” program, and after clicking “send” to create a profile with the uploaded image, I get:

Paperclip :: AdapterRegistry :: NoHandlerError in Update UsersController #

No handlers found for "Screen Shot 2012-09-01 at 11.03.43 AM.png"

My server log reads

Paperclip :: AdapterRegistry :: NoHandlerError (handler not found for "Screen Shot 2012-09-01 at 11.03.43 AM.png"): app / controllers / users_controller.rb: 65: in block in update' app/controllers/users_controller.rb:64:in update '

In my user model, I have

 attr_accessible :avatar has_attached_file :avatar, :styles => { :large => "500x500>", :medium => "213x213>", # profile image :thumb => "50x50>", :smaller => "30x30>" }, :processors => [:cropper], # tells paperclip how to crop the image :storage => :s3, :s3_credentials => "#{Rails.root}/config/s3.yml", # TODO :path => ":attachment/:id/:style/:basename.:extension", :bucket => 'eventsbucket' 

The error persists whether I include S3 information or not. In my migration, I,

 class AddAvatarColumnsToUsers < ActiveRecord::Migration def self.up add_attachment :users, :avatar end def self.down remove_attachment :users, :avatar end end 

Finally, in the My Users controller update action, I have

 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 

In my Gemfile, I have the gem "paperclip", "~> 3.1.4" (UPDATE: I have since pulled Paperclip straight out of my mind and the problem persists). I started the installation of the package. I ran db: migrate. I have read https://stackoverflow.com/a/165146/... but the error persists whether I enable “multipart => true” or not. When I tried the Emerson Lackey Tutorial , it worked to such an extent that it tried to display the output of "5.times ...".

I am interested in how to make Paperclip work, and understand what "NoHandlerError" is and how to avoid it in the future.

+4
source share
1 answer

Have you tried episode railscasts No. 134?

http://railscasts.com/episodes/134-paperclip?view=asciicast

0
source

Source: https://habr.com/ru/post/1433188/


All Articles