Mysql Rails rake db:创建错误:参数数量错误(给定7个,预期8个)
我在尝试运行rake db:create时遇到了这个错误:Mysql Rails rake db:创建错误:参数数量错误(给定7个,预期8个),mysql,ruby-on-rails,ruby,rake,Mysql,Ruby On Rails,Ruby,Rake,我在尝试运行rake db:create时遇到了这个错误: c:\ror\dev\AWI>rake db:create C:/ror/Ruby24-x64/lib/ruby/gems/2.4.0/gems/mysql2-0.4.10-x64-mingw32/lib/mysql2/2.4/mysql2.so: warning: constant ::TimeoutError is deprecated wrong number of arguments (given 7, expected
c:\ror\dev\AWI>rake db:create
C:/ror/Ruby24-x64/lib/ruby/gems/2.4.0/gems/mysql2-0.4.10-x64-mingw32/lib/mysql2/2.4/mysql2.so: warning: constant ::TimeoutError is deprecated
wrong number of arguments (given 7, expected 8)
Couldn't create database for {"adapter"=>"mysql2", "encoding"=>"utf8", "pool"=>5, "timeout"=>5000, "port"=>3000, "host"=>"localhost", "username"=>"root", "password"=>"newrootpassword", "database"=>"awi_development"}
rake aborted!
ArgumentError: wrong number of arguments (given 7, expected 8)
Tasks: TOP => db:create
(See full trace by running task with --trace)
它说我无法创建数据库,实际上我有9个参数。为什么它说我给了7分,为什么它期望8分
我正在使用
Ruby 2.4.2
Rails 5.1.4
MySQL 8.0.11
OS: Windows 10
您有一个参数,
Hash
的一个实例。该错误是由可能过时的mysql2
gem或类似版本引起的。我有两个mysql2 gem:mysql2(0.5.1 x64-mingw32,0.4.10 x64-mingw32)
。在哪里可以看到散列的实例。您不能同时拥有同一gem的两个版本;只有1个正在使用。2.你认为9个参数实际上是一个散列实例。如果这9个参数是一个参数,为什么它会说我已经给出了7个?我在哪里可以找到其他6个参数以及如何设置第8个参数?这只是一个提示,如果运行rake db:create--trace,也可以获得回溯