rails g model User name:string email:string
只要一运行 rake db:migrate 就报以下错误,新建其他 Model 也是,求助。
> bundle exec rake db:migrate
== 20141215151923 CreatePosts: migrating ======================================
-- create_table(:posts)
-> 0.0048s
== 20141215151923 CreatePosts: migrated (0.0049s) =============================
rake aborted!
StandardError: An error has occurred, this and all later migrations canceled:
wrong number of arguments (1 for 0)/home/diglike/.rvm/gems/ruby-2.1.4/gems/activerecord-4.2.0.beta4/lib/active_record/connection_adapters/abstract_adapter.rb:271:in `initialize'
/home/diglike/.rvm/gems/ruby-2.1.4/gems/activerecord-4.2.0.beta4/lib/active_record/connection_adapters/abstract_adapter.rb:271:in `new'
/home/diglike/.rvm/gems/ruby-2.1.4/gems/activerecord-4.2.0.beta4/lib/active_record/connection_adapters/abstract_adapter.rb:271:in `substitute_at'
/home/diglike/.rvm/gems/ruby-2.1.4/gems/activerecord-4.2.0.beta4/lib/active_record/relation.rb:97:in `block in substitute_values'
/home/diglike/.rvm/gems/ruby-2.1.4/gems/activerecord-4.2.0.beta4/lib/active_record/relation.rb:96:in `each'
/home/diglike/.rvm/gems/ruby-2.1.4/gems/activerecord-4.2.0.beta4/lib/active_record/relation.rb:96:in `each_with_index'
/home/diglike/.rvm/gems/ruby-2.1.4/gems/activerecord-4.2.0.beta4/lib/active_record/relation.rb:96:in `substitute_values'
/home/diglike/.rvm/gems/ruby-2.1.4/gems/activerecord-4.2.0.beta4/lib/active_record/relation.rb:56:in `insert'
我的 Gemfile 如下:
source 'https://rubygems.org'
gem 'rails', '4.2.0.beta4'
gem 'sqlite3', '1.3.10'
gem 'sass-rails', '5.0.0.beta1'
gem 'bootstrap-sass', '3.3.1.0'
gem 'uglifier', '2.6.0'
gem 'coffee-rails', '4.1.0'
gem 'jquery-rails', '4.0.0.beta2'
gem 'turbolinks', '2.5.3'
gem 'jbuilder', '2.2.5'
gem 'sdoc', '0.4.0', group: :doc
group :development, :test do
gem 'byebug', '3.5.1'
gem 'web-console', '2.0.0.beta4'
gem 'spring', '1.2.0'
end
group :test do
gem 'minitest-reporters', '1.0.8'
gem 'mini_backtrace', '0.1.3'
gem 'guard-minitest', '2.3.2'
end