I encounter error undefined method `new’ for Paperclip:Module
while running rake db:migrate to update table for PaperClip.
Herewith in migration class
class ForPaperclip < ActiveRecord::Migration
def self.up
change_table :photos do |t|
t.has_attached_file :shot
end
end
def self.down
drop_attached_file :photos, :shot
end
end
I am using paperclip 2.6.0, ruby 1.9.2, rails 3.1.0
Any idea?
Below is the error stack.
/Users/Sa/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.0/lib/active_record/migration.rb:517:in `load_migration'
/Users/Sa/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.0/lib/active_record/migration.rb:512:in `migration'
/Users/Sa/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.0/lib/active_record/migration.rb:509:in `rescue in migrate'
/Users/Sa/.rvm/gems/ruby-1.9.2-p290/gems/activerecord-3.1.0/lib/active_record/migration.rb:507:in `migrate'
sorry, this is really my bad. I created the migration file called *_paperclip.txt thus rails is unnecessarily looking for Paperclip module. It works fine, after I rename the migration file