bbenezech/papermill

Uncaught exception: undefined method `has_attached_file'

Closed this issue · 5 comments

Hi,
today I updated my gems. "PaperClip" was updated to the 2.3.3 version.

Now, when I start my web-brick, it want not to start. The message is the following:
=> Booting WEBrick
=> Rails 2.3.5 application starting on http://0.0.0.0:3000
C:/Ruby187/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/base.rb:1959:in method_missing_without_paginate' C:/Ruby187/lib/ruby/gems/1.8/gems/will_paginate-2.3.14/lib/will_paginate/finder.rb:170:inmethod_missing'
C:/Ruby187/lib/ruby/gems/1.8/gems/papermill-2.0.2/lib/papermill/papermill_asset.rb:4
C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in gem_original_require' C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:inrequire'
C:/Ruby187/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in require' C:/Ruby187/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:521:innew_constants_in'
C:/Ruby187/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in require' C:/Ruby187/lib/ruby/gems/1.8/gems/papermill-2.0.2/lib/papermill.rb:29 C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:ingem_original_require'
C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in require' C:/Ruby187/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:inrequire'
C:/Ruby187/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:521:in new_constants_in' C:/Ruby187/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:inrequire'
C:/Ruby187/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/rails/gem_dependency.rb:208:in load' C:/Ruby187/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:307:inload_gems'
C:/Ruby187/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:307:in each' C:/Ruby187/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:307:inload_gems'
C:/Ruby187/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:164:in process' C:/Ruby187/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:113:insend'
C:/Ruby187/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:113:in run' F:/Michele/Projects/Rails/saporitipici/config/environment.rb:9 C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:ingem_original_require'
C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in require' C:/Ruby187/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:inrequire'
C:/Ruby187/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:521:in new_constants_in' C:/Ruby187/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:inrequire'
C:/Ruby187/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/commands/server.rb:84
C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in gem_original_require' C:/Ruby187/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:inrequire'
./script\server:3
C:/Ruby187/lib/ruby/gems/1.8/gems/ruby-debug-ide-0.4.9/lib/ruby-debug-ide.rb:109:in debug_load' C:/Ruby187/lib/ruby/gems/1.8/gems/ruby-debug-ide-0.4.9/lib/ruby-debug-ide.rb:109:indebug_program'
C:/Ruby187/lib/ruby/gems/1.8/gems/ruby-debug-ide-0.4.9/bin/rdebug-ide:87
C:/Ruby187/bin/rdebug-ide:19:in load' C:/Ruby187/bin/rdebug-ide:19 Uncaught exception: undefined methodhas_attached_file' for #Class:0x9090978


Where is the problem?
Papermill doen't compatible with the new Paperclip gem?

Many thanks for your kindly support,
Cheers,
Mick

I am having the same problem as well update to paperclip 2.3.3 on rails 2.3.8 with bundler installed

I think I have a solution for rails 2.3.8 which uses bundler after reading this article http://patshaughnessy.net/2010/5/23/how-to-install-paperclip-in-a-rails-3-app - The reason I read it was I sensed that bundler was causing the problem. To solve I generated the papermill_assets migration from an app without bundler and copied it over to my current project. then at the top of the papermill.rb initializer I added Paperclip::Railtie.insert.

Great! Perfect now it works!
Thanks dbkrett!

From what I've seen, Papermill is NOT compatible with Paperclip 2.3.3 (can't generate Thumbs)
I forced Paperclip 2.2.1.1 in last Papermill release until I found a workaround.

Thanks for the tip anyway, I'll need it to early-load Paperclip (as you've found out).

If Paperclip is compatible Rails3, I'll go for a Rails3 branch as soon as the RC is out.

Tell me if Papermill 2.1.0 does it for you (it includes a few other bugfixes)

Cheers !

Benoit, great plug-in, one of the best I have found for multi-image with paperclip, I noticed from the server log, that with Paperclip 2.3.3 the thumbs were failing on the imagick convert command specifically the resize to file name has no extension. Was trying to track down in your code whether this was a paperclip problem or specific to how the file extension name is generated in papermill - gave up and tried to download your update as a gem but as you had only recently modified it I had problems, as gemcutter and github were serving me 2.0.2 as the latest version. I will try again tomorrow and let you know how it goes. Many thanks for producing a nice gem.

Regards

David