Skip to content
This repository has been archived by the owner on Jul 13, 2023. It is now read-only.

undefined method `class_attribute' for ActiveRecord::Base:Class (NoMethodError) #534

Closed
blanchma opened this issue Jul 21, 2011 · 4 comments
Assignees
Milestone

Comments

@blanchma
Copy link

After updating paperclip:

matias@matias-laptop:~/livechains/branches/test/livechains$ bundle update
Updating git://github.com/kotfu/whenever.git
Updating git://github.com/chrisle/gattica.git
Fetching source index for http://rubygems.org/
Enter your password to install the bundled RubyGems to your system:
Using rake (0.9.2)
Using aaronh-chronic (0.3.9)
Using activesupport (2.3.8)
Using rack (1.1.2)
Using actionpack (2.3.8)
Using actionmailer (2.3.8)
Using activerecord (2.3.8)
Using activeresource (2.3.8)
Using addressable (2.2.6)
Using adzap-ar_mailer (2.1.8)
Using alexvollmer-daemon-spawn (0.2.0)
Using babosa (0.3.5)
Using crack (0.1.6)
Using httparty (0.5.2)
Using multipart-post (1.1.2)
Using faraday (0.6.1)
Using multi_json (1.0.3)
Using oauth2 (0.4.1)
Using bitly (0.6.1)
Using cgi_multipart_eof_fix (2.5.0)
Using cocaine (0.1.0)
Using daemons (1.0.10)
Using delayed_job (2.0.7)
Using warden (0.10.7)
Using devise (1.0.9)
Using fastthread (1.0.7)
Using friendly_id (3.2.1.1)
Using hpricot (0.8.4)
Using test-unit (2.3.0)
Using gattica (0.5.1) from git://github.com/chrisle/gattica.git (at master)
Using gem_plugin (0.2.3)
Using gvis (1.0.2)
Using hashie (0.2.2)
Using i18n (0.6.0)
Using json (1.4.6)
Using mime-types (1.16)
Using rest-client (1.6.3)
Using mini_fb (1.1.7)
Using mongrel (1.1.5)
Using mysql (2.8.1)
Using ruby-hmac (0.4.0)
Using oauth (0.3.6)
Using paperclip (2.3.15)
Using rails (2.3.8)
Using rspec (1.3.0)
Using rspec-rails (1.3.2)
Using twitter (0.9.1)
Using whenever (0.6.1) from git://github.com/kotfu/whenever.git (at master)
Using will_paginate (2.3.15)
Using bundler (1.0.7)
Updating .gem files in vendor/cache

  • cocaine-0.1.0.gem
  • paperclip-2.3.15.gem
    Removing outdated .gem files from vendor/cache
  • fiveruns_tuneup-0.8.20.gem
  • paperclip-2.3.11.gem

I get this error:

/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.8/lib/active_record/base.rb:1994:in method_missing_without_paginate': undefined methodclass_attribute' for ActiveRecord::Base:Class (NoMethodError)
from /usr/lib/ruby/gems/1.8/gems/will_paginate-2.3.15/lib/will_paginate/finder.rb:170:in method_missing' from /usr/lib/ruby/gems/1.8/gems/paperclip-2.3.15/lib/paperclip.rb:182:inincluded'
from /usr/lib/ruby/gems/1.8/gems/paperclip-2.3.15/lib/paperclip/railtie.rb:20:in include' from /usr/lib/ruby/gems/1.8/gems/paperclip-2.3.15/lib/paperclip/railtie.rb:20:insend'
from /usr/lib/ruby/gems/1.8/gems/paperclip-2.3.15/lib/paperclip/railtie.rb:20:in insert' from /usr/lib/ruby/gems/1.8/gems/paperclip-2.3.15/rails/init.rb:2:inevaluate_init_rb'
from /usr/lib/ruby/gems/1.8/gems/rails-2.3.8/lib/rails/plugin.rb:158:in evaluate_init_rb' from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.8/lib/active_support/core_ext/kernel/reporting.rb:11:insilence_warnings'
from /usr/lib/ruby/gems/1.8/gems/rails-2.3.8/lib/rails/plugin.rb:154:in evaluate_init_rb' from /usr/lib/ruby/gems/1.8/gems/rails-2.3.8/lib/rails/plugin.rb:48:inload'
from /usr/lib/ruby/gems/1.8/gems/rails-2.3.8/lib/rails/plugin/loader.rb:38:in load_plugins' from /usr/lib/ruby/gems/1.8/gems/rails-2.3.8/lib/rails/plugin/loader.rb:37:ineach'
from /usr/lib/ruby/gems/1.8/gems/rails-2.3.8/lib/rails/plugin/loader.rb:37:in load_plugins' from /usr/lib/ruby/gems/1.8/gems/rails-2.3.8/lib/initializer.rb:369:inload_plugins'
from /usr/lib/ruby/gems/1.8/gems/rails-2.3.8/lib/initializer.rb:165:in process' from /usr/lib/ruby/gems/1.8/gems/rails-2.3.8/lib/initializer.rb:113:insend'
from /usr/lib/ruby/gems/1.8/gems/rails-2.3.8/lib/initializer.rb:113:in run' from /home/matias/livechains/branches/test/livechains/config/environment.rb:11 from /usr/lib/ruby/gems/1.8/gems/rails-2.3.8/lib/commands/generate.rb:1:inrequire'
from /usr/lib/ruby/gems/1.8/gems/rails-2.3.8/lib/commands/generate.rb:1
from script/generate:3:in `require'
from script/generate:3

@blanchma
Copy link
Author

Paperclip version: > 2.3.11 , give me sometype of error.

NoMethodError: undefined method has_attached_file' for #<Class:0x7f614b788468> from /home/matias/livechains/branches/test/livechains/paperclip/ruby/1.8/gems/activerecord-2.3.8/lib/active_record/base.rb:1994:inmethod_missing_without_paginate'

I think its something about will_paginate too.

@blanchma blanchma reopened this Jul 22, 2011
@ghost ghost assigned sikachu Jul 22, 2011
@aya-soft
Copy link
Contributor

Please change quickly, if it possible, line 182 (module Glue):
base.class_attribute :attachment_definitions
to:
if base.respond_to?(:class_attributes)
base.class_attribute :attachment_definitions
end

Thanx

@sikachu
Copy link
Contributor

sikachu commented Jul 27, 2011

If you want it to change quickly, then sends a pull request with change.

@sikachu
Copy link
Contributor

sikachu commented Jul 29, 2011

This has been fixed and released in 2.3.16

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants