Скрепка 2.6.0 прерывается!унифицированная константа ошибка AddAvatarColumnsToUser - PullRequest
1 голос
/ 16 февраля 2012

Я следую за Quickstart на Github для установки Paperclip и получения ошибки при попытке перенести мою базу данных.Я включил ошибку из терминала ниже.Я использую Mac OSX.Я думаю, что это как-то связано с Imagemagick, но не уверен.У меня есть скрепка 2.6.0 и Rails 3.2.0.Если кто-то знает ответ, я был бы невероятно благодарен, так как я не нашел после нескольких часов поиска.

    Timothy-Muellers-MacBook-Pro:Publishr tmuelle1$ rake db:migrate --trace
    ** Invoke db:migrate (first_time)
    ** Invoke environment (first_time)
    ** Execute environment
    ** Invoke db:load_config (first_time)
    ** Invoke rails_env (first_time)
    ** Execute rails_env
    ** Execute db:load_config
    ** Execute db:migrate
    rake aborted!
    An error has occurred, this and all later migrations canceled:

    uninitialized constant AddAvatarColumnsToUsers
    /Users/tmuelle1/.rvm/gems/ruby-1.9.2-head@rails3tutorial/gems/activesupport-3.2.0.rc1/lib/active_support/inflector/methods.rb:226:in `block in constantize'
    /Users/tmuelle1/.rvm/gems/ruby-1.9.2-head@rails3tutorial/gems/activesupport-3.2.0.rc1/lib/active_support/inflector/methods.rb:225:in `each'
    /Users/tmuelle1/.rvm/gems/ruby-1.9.2-head@rails3tutorial/gems/activesupport-3.2.0.rc1/lib/active_support/inflector/methods.rb:225:in `constantize'
    /Users/tmuelle1/.rvm/gems/ruby-1.9.2-head@rails3tutorial/gems/activesupport-3.2.0.rc1/lib/active_support/core_ext/string/inflections.rb:54:in `constantize'
    /Users/tmuelle1/.rvm/gems/ruby-1.9.2-head@rails3tutorial/gems/activerecord-3.2.0.rc1/lib/active_record/migration.rb:521:in `load_migration'
    /Users/tmuelle1/.rvm/gems/ruby-1.9.2-head@rails3tutorial/gems/activerecord-3.2.0.rc1/lib/active_record/migration.rb:516:in `migration'
    /Users/tmuelle1/.rvm/gems/ruby-1.9.2-head@rails3tutorial/gems/activerecord-3.2.0.rc1/lib/active_record/migration.rb:511:in `migrate'
    /Users/tmuelle1/.rvm/gems/ruby-1.9.2-head@rails3tutorial/gems/activerecord-3.2.0.rc1/lib/active_record/migration.rb:696:in `block (2 levels) in migrate'
    /Users/tmuelle1/.rvm/gems/ruby-1.9.2-head@rails3tutorial/gems/activerecord-3.2.0.rc1/lib/active_record/migration.rb:751:in `call'
    /Users/tmuelle1/.rvm/gems/ruby-1.9.2-head@rails3tutorial/gems/activerecord-3.2.0.rc1/lib/active_record/migration.rb:751:in `block in ddl_transaction'
    /Users/tmuelle1/.rvm/gems/ruby-1.9.2-head@rails3tutorial/gems/activerecord-3.2.0.rc1/lib/active_record/connection_adapters/abstract/database_statements.rb:190:in `transaction'
    /Users/tmuelle1/.rvm/gems/ruby-1.9.2-head@rails3tutorial/gems/activerecord-3.2.0.rc1/lib/active_record/transactions.rb:208:in `transaction'
    /Users/tmuelle1/.rvm/gems/ruby-1.9.2-head@rails3tutorial/gems/activerecord-3.2.0.rc1/lib/active_record/migration.rb:751:in `ddl_transaction'
    /Users/tmuelle1/.rvm/gems/ruby-1.9.2-head@rails3tutorial/gems/activerecord-3.2.0.rc1/lib/active_record/migration.rb:695:in `block in migrate'
    /Users/tmuelle1/.rvm/gems/ruby-1.9.2-head@rails3tutorial/gems/activerecord-3.2.0.rc1/lib/active_record/migration.rb:676:in `each'
    /Users/tmuelle1/.rvm/gems/ruby-1.9.2-head@rails3tutorial/gems/activerecord-3.2.0.rc1/lib/active_record/migration.rb:676:in `migrate'
    /Users/tmuelle1/.rvm/gems/ruby-1.9.2-head@rails3tutorial/gems/activerecord-3.2.0.rc1/lib/active_record/migration.rb:553:in `up'
    /Users/tmuelle1/.rvm/gems/ruby-1.9.2-head@rails3tutorial/gems/activerecord-3.2.0.rc1/lib/active_record/migration.rb:534:in `migrate'
    /Users/tmuelle1/.rvm/gems/ruby-1.9.2-head@rails3tutorial/gems/activerecord-3.2.0.rc1/lib/active_record/railties/databases.rake:152:in `block (2 levels) in <top (required)>'
    /Users/tmuelle1/.rvm/gems/ruby-1.9.2-head@rails3tutorial/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
    /Users/tmuelle1/.rvm/gems/ruby-1.9.2-head@rails3tutorial/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `block in execute'
    /Users/tmuelle1/.rvm/gems/ruby-1.9.2-head@rails3tutorial/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
    /Users/tmuelle1/.rvm/gems/ruby-1.9.2-head@rails3tutorial/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
    /Users/tmuelle1/.rvm/gems/ruby-1.9.2-head@rails3tutorial/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
    /Users/tmuelle1/.rvm/rubies/ruby-1.9.2-head/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
    /Users/tmuelle1/.rvm/gems/ruby-1.9.2-head@rails3tutorial/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
    /Users/tmuelle1/.rvm/gems/ruby-1.9.2-head@rails3tutorial/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
    /Users/tmuelle1/.rvm/gems/ruby-1.9.2-head@rails3tutorial/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task'
    /Users/tmuelle1/.rvm/gems/ruby-1.9.2-head@rails3tutorial/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block (2 levels) in top_level'
    /Users/tmuelle1/.rvm/gems/ruby-1.9.2-head@rails3tutorial/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each'
    /Users/tmuelle1/.rvm/gems/ruby-1.9.2-head@rails3tutorial/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block in top_level'
    /Users/tmuelle1/.rvm/gems/ruby-1.9.2-head@rails3tutorial/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
    /Users/tmuelle1/.rvm/gems/ruby-1.9.2-head@rails3tutorial/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'
    /Users/tmuelle1/.rvm/gems/ruby-1.9.2-head@rails3tutorial/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `block in run'
    /Users/tmuelle1/.rvm/gems/ruby-1.9.2-head@rails3tutorial/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
    /Users/tmuelle1/.rvm/gems/ruby-1.9.2-head@rails3tutorial/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
    /Users/tmuelle1/.rvm/gems/ruby-1.9.2-head@rails3tutorial/gems/rake-0.9.2.2/bin/rake:33:in `<top (required)>'
    /Users/tmuelle1/.rvm/gems/ruby-1.9.2-head@rails3tutorial/bin/rake:19:in `load'
    /Users/tmuelle1/.rvm/gems/ruby-1.9.2-head@rails3tutorial/bin/rake:19:in `<main>'
    Tasks: TOP => db:migrate

1 Ответ

1 голос
/ 18 февраля 2012

Это была моя ошибка. Моя таблица пользователей называется users, а не user. Я по ошибке скопировал дословно то, что у них было, и в направлениях миграции в Руководстве по быстрому старту было сказано:

class AddAvatarColumnsToUser < ActiveRecord::Migration 

вместо

class AddAvatarColumnsToUsers < ActiveRecord::Migration

Это то, что вызывает ошибку.

...