新手问题 Rails 4.2.0 rake db:migrate 报错

spacex · December 02, 2014 · Last by bobby_chen replied at December 11, 2014 · 2588 hits
== 20141202071009 CreateUsers: migrating ======================================
-- create_table(:users)
   -> 0.0032s
== 20141202071009 CreateUsers: migrated (0.0033s) =============================

rake aborted!
StandardError: An error has occurred, this and all later migrations canceled:

wrong number of arguments (1 for 0)/home/atom/.rvm/gems/ruby-2.1.2/gems/activerecord-4.2.0.beta4/lib/active_record/connection_adapters/abstract_adapter.rb:271:in `initialize'

反复试了几次都是这样,有同样遇到这问题的吗?

最好贴上源码

确定 migration 文件语法没有错误?

Rails 4.2.0.beta4 依赖的 arel 有问题,会导致迁移报错。在 Gemfile 中把 Rails 的版本号改为 4.2.0.rc1

是 Rails 版本问题,已经解决,谢了。

赞~andor_chen

You need to Sign in before reply, if you don't have an account, please Sign up first.