Git Product home page Git Product logo

Comments (8)

ScotterC avatar ScotterC commented on August 16, 2024

Thanks for reporting. Can you include a backtrace please?

from delayed_paperclip.

kotaiahpendurthi avatar kotaiahpendurthi commented on August 16, 2024

Hi,
Earlier i have two gem in my gem file. one is paperclip and another one is delayed_paperclip. Now i have removed paperclip gem. Now it is working fine. Here i am adding the backtrace

EXCEPTION IS:

undefined local variable or method `attachment_definitions' for #<Class:0x00000009975190>
["/home/paradigm/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.2.12/lib/active_record/dynamic_matchers.rb:55:in `method_missing'",
"/home/paradigm/.rvm/gems/ruby-1.9.3-p448/bundler/gems/delayed_paperclip-5b25db8968ab/lib/delayed_paperclip.rb:51:in `process_in_background'",
"/home/paradigm/workspace/ActiveFam/app/models/resource.rb:29:in `<class:Resource>'",
"/home/paradigm/workspace/ActiveFam/app/models/resource.rb:1:in `<top (required)>'",
"/home/paradigm/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:469:in `load'",
"/home/paradigm/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:469:in `block in load_file'",
"/home/paradigm/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:639:in `new_constants_in'",
"/home/paradigm/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:468:in `load_file'",
"/home/paradigm/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:353:in `require_or_load'",
"/home/paradigm/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:502:in `load_missing_constant'",
"/home/paradigm/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:192:in `block in const_missing'",
"/home/paradigm/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:190:in `each'",
"/home/paradigm/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:190:in `const_missing'",
"/home/paradigm/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:514:in `load_missing_constant'",
"/home/paradigm/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:192:in `block in const_missing'",
"/home/paradigm/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:190:in `each'",
"/home/paradigm/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:190:in 

Also how do we get the original url before generating the style? Can you please help me out.

from delayed_paperclip.

ScotterC avatar ScotterC commented on August 16, 2024

attachment_definitions is a class method method for a model that has_attached_file. When you install the paperclip gem. Did you have the line has_attached_file in your resource model?

from delayed_paperclip.

kotaiahpendurthi avatar kotaiahpendurthi commented on August 16, 2024

hi please find the attached code in my model

has_attached_file :image , :default_url => "/assets/member.png",
    :storage => :s3,
    :bucket => ENV['AMAZON_BUCKET_NAME'],
    :s3_credentials => {
      :access_key_id => ENV['AMAZON_API_KEY'],
      :secret_access_key => ENV['AMAZON_API_SECRET']
    },
    :s3_protocol => "https",
    :styles => {
    :big => "600X600!",
    :large => "300x300!",
    :thumb => "148x121!",
    :gallery => "130x112!",
    :medium => "70X72!",
    :tiny => "67X55!",
    :small =>"21X21!"
  }

  validates_attachment_content_type :image, :content_type =>  ['image/gif','image/jpeg','image/png','image/bmp'] ,:message => 'must be gif,jpeg,png,bmp'
  validates_attachment_size :image, :less_than => 10.megabytes

  process_in_background :image, :only_process => [:big, :large,:thumb, :gallery,:medium,:small,:tiny]

from delayed_paperclip.

ScotterC avatar ScotterC commented on August 16, 2024

Nothing looks wrong on the surface. What versions of paperclip and delayed_paperclip are you using?

from delayed_paperclip.

kotaiahpendurthi avatar kotaiahpendurthi commented on August 16, 2024

Please find the gem files which we are using in my app.
gem "paperclip", :git => "git://github.com/thoughtbot/paperclip.git"
gem 'delayed_paperclip', :git => "https://github.com/jrgifford/delayed_paperclip"

from delayed_paperclip.

ScotterC avatar ScotterC commented on August 16, 2024

Is there a reason you're using the master branch of both gems? Try just

  gem 'paperclip'
  gem 'delayed_paperclip'

from delayed_paperclip.

ScotterC avatar ScotterC commented on August 16, 2024

It looks like paperclip 3.5 is what creates this problem. Lock your paperclip version to 3.4.2

gem 'paperclip', '3.4.2'

from delayed_paperclip.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.