2013-07-21 4 views
8

मैं रेक डीबी चलाने की कोशिश कर रहा हूं: हेरोकू पर माइग्रेट कमांड और मैं इस समस्या में भाग रहा हूं।डीबी पर त्रुटि: माइग्रेट करें "अनियंत्रित निरंतर DeviseCreateUsers"

uninitialized constant DeviseCreateUsers 
/app/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.11/lib/active_support/inflector/methods.rb:230:in `block in constantize' 
/app/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.11/lib/active_support/inflector/methods.rb:229:in `each' 
/app/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.11/lib/active_support/inflector/methods.rb:229:in `constantize' 
/app/vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.11/lib/active_support/core_ext/string/inflections.rb:54:in `constantize' 
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.11/lib/active_record/migration.rb:538:in `load_migration' 
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.11/lib/active_record/migration.rb:533:in `migration' 
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.11/lib/active_record/migration.rb:528:in `migrate' 
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.11/lib/active_record/migration.rb:720:in `block (2 levels) in migrate' 
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.11/lib/active_record/migration.rb:775:in `call' 
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.11/lib/active_record/migration.rb:775:in `block in ddl_transaction' 
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.11/lib/active_record/connection_adapters/abstract/database_statements.rb:192:in `transaction' 
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.11/lib/active_record/transactions.rb:208:in `transaction' 
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.11/lib/active_record/migration.rb:775:in `ddl_transaction' 
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.11/lib/active_record/migration.rb:719:in `block in migrate' 
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.11/lib/active_record/migration.rb:700:in `each' 
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.11/lib/active_record/migration.rb:700:in `migrate' 
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.11/lib/active_record/migration.rb:570:in `up' 
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.11/lib/active_record/migration.rb:551:in `migrate' 
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.11/lib/active_record/railties/databases.rake:179:in `block (2 levels) in <top (required)>' 

यहां मेरे डेविस बनाने उपयोगकर्ता विधि का पूर्ण टेक्स्ट है जो इस समस्या का कारण बनता प्रतीत होता है।

class AddDeviseToCustomers < ActiveRecord::Migration 
def self.up 
change_table(:customers) do |t| 
    ## Database authenticatable 
    t.string :email,    :null => false, :default => "" 
    t.string :encrypted_password, :null => false, :default => "" 

    ## Recoverable 
    t.string :reset_password_token 
    t.datetime :reset_password_sent_at 

    ## Rememberable 
    t.datetime :remember_created_at 

    ## Trackable 
    t.integer :sign_in_count, :default => 0 
    t.datetime :current_sign_in_at 
    t.datetime :last_sign_in_at 
    t.string :current_sign_in_ip 
    t.string :last_sign_in_ip 
    t.string :confirmation_token 
    t.datetime :confirmed_at 
    t.datetime :confirmation_sent_at 

    ## Confirmable 

    #t.string :unconfirmed_email # Only if using reconfirmable 

    ## Lockable 
    # t.integer :failed_attempts, :default => 0 # Only if lock strategy is :failed_attempts 
    # t.string :unlock_token # Only if unlock strategy is :email or :both 
    # t.datetime :locked_at 

    ## Token authenticatable 
    # t.string :authentication_token 


    # Uncomment below if timestamps were not included in your original model. 
    # t.timestamps 

    add_index :users, :email,    :unique => true 
    add_index :users, :reset_password_token, :unique => true 
    # add_index :users, :confirmation_token, :unique => true 
    # add_index :users, :unlock_token,   :unique => true 
    # add_index :users, :authentication_token, :unique => true 
    end 
end 
end 

यह सब उसकेोकू पर एक pgsql सर्वर पर है। अग्रिम में धन्यवाद

उत्तर

20

ऐसा होता है यदि आपने माइग्रेशन का नाम बदल दिया है और माइग्रेशन फ़ाइल नाम का नाम नहीं बदला है।

उदा अगर प्रवास वर्ग के नाम

AddDeviseToCustomers 

तो माइग्रेशन फ़ाइल नाम होना चाहिए

201307220112_add_devise_to_customers.rb 
+1

धन्यवाद, कि सटीक समस्या थी। – rockyroadster555

संबंधित मुद्दे