我正在开发关于 Ruby on Rails 的项目直到现在我使用 Rails 4 并且在遇到 gems 无法使用问题之前一切都很好。我决定回滚到 Rails 3,更改了我的 Gemfile,删除了 Gemfile.lock,所有 rails 安装和 railties。然后我运行 bundle install 并安装了 Rails 3.2.13。但是现在当我运行 rake db:create 时,一切都还好。当我运行 rake db:migrate 时,问题开始了:
JeffreeBook:llvoo kristijonas$ rake db:migrate
WARNING: Nokogiri was built against LibXML version 2.8.0, but has dynamically loaded 2.7.8
rake aborted!
undefined method `migration_error=' for ActiveRecord::Base:Class
/Users/kristijonas/.rvm/gems/ruby-1.9.3-p448@fashion/gems/activerecord-3.2.13/lib/active_record/dynamic_matchers.rb:55:in `method_missing'
/Users/kristijonas/.rvm/gems/ruby-1.9.3-p448@fashion/gems/activerecord-3.2.13/lib/active_record/railtie.rb:66:in `block (3 levels) in <class:Railtie>'
/Users/kristijonas/.rvm/gems/ruby-1.9.3-p448@fashion/gems/activerecord-3.2.13/lib/active_record/railtie.rb:65:in `each'
/Users/kristijonas/.rvm/gems/ruby-1.9.3-p448@fashion/gems/activerecord-3.2.13/lib/active_record/railtie.rb:65:in `block (2 levels) in <class:Railtie>'
/Users/kristijonas/.rvm/gems/ruby-1.9.3-p448@fashion/gems/activesupport-3.2.13/lib/active_support/lazy_load_hooks.rb:36:in `instance_eval'
/Users/kristijonas/.rvm/gems/ruby-1.9.3-p448@fashion/gems/activesupport-3.2.13/lib/active_support/lazy_load_hooks.rb:36:in `execute_hook'
/Users/kristijonas/.rvm/gems/ruby-1.9.3-p448@fashion/gems/activesupport-3.2.13/lib/active_support/lazy_load_hooks.rb:43:in `block in run_load_hooks'
/Users/kristijonas/.rvm/gems/ruby-1.9.3-p448@fashion/gems/activesupport-3.2.13/lib/active_support/lazy_load_hooks.rb:42:in `each'
/Users/kristijonas/.rvm/gems/ruby-1.9.3-p448@fashion/gems/activesupport-3.2.13/lib/active_support/lazy_load_hooks.rb:42:in `run_load_hooks'
/Users/kristijonas/.rvm/gems/ruby-1.9.3-p448@fashion/gems/activerecord-3.2.13/lib/active_record/base.rb:720:in `<top (required)>'
/Users/kristijonas/.rvm/gems/ruby-1.9.3-p448@fashion/gems/activerecord-3.2.13/lib/active_record/railties/databases.rake:25:in `block (2 levels) in <top (required)>'
/Users/kristijonas/.rvm/gems/ruby-1.9.3-p448@fashion/bin/ruby_noexec_wrapper:14:in `eval'
/Users/kristijonas/.rvm/gems/ruby-1.9.3-p448@fashion/bin/ruby_noexec_wrapper:14:in `<main>'
Tasks: TOP => db:migrate => db:load_config
(See full trace by running task with --trace)
JeffreeBook:llvoo kristijonas$
如何解决?使用 db config 一切正常