2012-02-14 64 views
0

我遇到錯誤未定義的方法`新'的回形針:模塊 運行時rake db:遷移到更新表的PaperClip。未定義的方法`新'的回形針:模塊

。由此在移民類

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 

我使用回形針2.6.0,1.9.2紅寶石,導軌3.1.0 任何想法?

下面是錯誤堆棧。

/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' 

回答

0

對不起,這真的是我的壞話。我創建了名爲* _paperclip.txt的遷移文件,因此rails不必要地尋找Paperclip模塊。它工作正常後,我重命名遷移文件

相關問題