views:

1034

answers:

7

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>
A: 

it works with Jason King's paperclip version:

gem 'paperclip', :git => 'http://github.com/JasonKing/paperclip.git', :branch => 'rails3'
mirza
This doesn't appear to exist any more.
Sam Soffes
A: 

Are you able to use a paperclip generator or are you just creating the columns manually? After I install either version, I still get paperclip generator not found.

Eric M.
A: 

not only that - but "has_attached_file" will go undefined if referenced in one of your models... i need a fix :(

zak
This is not an answer. For "me too" type comments, please comment instead of posting an answer. lmumar's forked worked for me by the way.
Sam Soffes
+2  A: 

hi,

I have a paperclip fork, you can try if it will work at your end, just change your Gemfile:

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

Don't forget to run bundle install after updating your Gemfile.

Hope it will fix your problems.

lmumar

"There was a LoadError while evaluating paperclip.gemspec.Does it try to require a relative path? That doesn't work in Ruby 1.9."
mirza
Thanks - working for me :-)This will keep me going until the master gets fixed fully for Rails3.
firecall
This fork worked for me as well. Hopefully thoughtbot will pull from lmumar soon :)
Sam Soffes
A: 

Imunar's fork worked for me.

just change your Gemfile:

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

(Imunar: sorry I couldn't upvote your answer)

digitalfrost
Jason King's paperclip version is no longer available on github
digitalfrost
A: 

minter's fork worked for me:

gem 'paperclip', :git => 'http://github.com/minter/paperclip.git', :branch => 'rails3'
mirza
+4  A: 

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"
Sam Soffes