Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NoMethodError: undefined method `has_attached_file'

Paperclip produces this error, after checking out the plugin's rails3 branch. My Gemfile has following line:

gem 'paperclip', :git => 'http://github.com/thoughtbot/paperclip.git', :branch => 'rails3'

And the error message is:

NoMethodError: undefined method `has_attached_file' for #<Class:0x2a50530>
like image 425
mirza Avatar asked Apr 30 '10 10:04

mirza


1 Answers

Update 06-21-10: the thoughtbot version has been fixed.

I had to add Paperclip::Railtie.insert to my application.rb at the end of class Application < Rails::Application to get it to work correctly. I have deleted my fork since the official repo is working. Hope that helps someone.

You will also need to add the following to your Gemfile

gem "paperclip", :git => "http://github.com/thoughtbot/paperclip.git"
like image 92
Sam Soffes Avatar answered Oct 05 '22 14:10

Sam Soffes