数据库
首页 > 数据库> > mysql-Rails-rake db:create error

mysql-Rails-rake db:create error

作者:互联网

我正在尝试为MySQL数据库运行rake db:create但出现错误

$rake db:create
rake aborted!
undefined method `task' for #<Sharebox::Application:0x0000010085a010>

Ive运行–trace并获取信息

/Users/lucasdobbins/.rvm/gems/ruby-1.9.2-head/gems/railties-3.0.7/lib/rails/application.rb:215:in `initialize_tasks'
/Users/lucasdobbins/.rvm/gems/ruby-1.9.2-head/gems/railties-3.0.7/lib/rails/application.rb:139:in `load_tasks'
/Users/lucasdobbins/.rvm/gems/ruby-1.9.2-head/gems/railties-3.0.7/lib/rails/application.rb:77:in `method_missing'
/Users/lucasdobbins/rails_projects/sharebox/Rakefile:7:in `<top (required)>'
/Users/lucasdobbins/.rvm/gems/ruby-1.9.2-head/gems/rake-0.9.0/lib/rake/rake_module.rb:25:in `load'
/Users/lucasdobbins/.rvm/gems/ruby-1.9.2-head/gems/rake-0.9.0/lib/rake/rake_module.rb:25:in `load_rakefile'
/Users/lucasdobbins/.rvm/gems/ruby-1.9.2-head/gems/rake-0.9.0/lib/rake/application.rb:495:in `raw_load_rakefile'
/Users/lucasdobbins/.rvm/gems/ruby-1.9.2-head/gems/rake-0.9.0/lib/rake/application.rb:78:in `block in load_rakefile'
/Users/lucasdobbins/.rvm/gems/ruby-1.9.2-head/gems/rake-0.9.0/lib/rake/application.rb:129:in `standard_exception_handling'
/Users/lucasdobbins/.rvm/gems/ruby-1.9.2-head/gems/rake-0.9.0/lib/rake/application.rb:77:in `load_rakefile'
/Users/lucasdobbins/.rvm/gems/ruby-1.9.2-head/gems/rake-0.9.0/lib/rake/application.rb:61:in `block in run'
/Users/lucasdobbins/.rvm/gems/ruby-1.9.2-head/gems/rake-0.9.0/lib/rake/application.rb:129:in `standard_exception_handling'
/Users/lucasdobbins/.rvm/gems/ruby-1.9.2-head/gems/rake-0.9.0/lib/rake/application.rb:59:in `run'
/Users/lucasdobbins/.rvm/gems/ruby-1.9.2-head/gems/rake-0.9.0/bin/rake:31:in `<top (required)>'
/Users/lucasdobbins/.rvm/gems/ruby-1.9.2-head/bin/rake:19:in `load'
/Users/lucasdobbins/.rvm/gems/ruby-1.9.2-head/bin/rake:19:in `<main>'

这是我的database.yml文件

development:
  adapter: mysql
  encoding: utf8
  reconnect: false
  database: sharebox_development
  pool: 5
  username: root
  password:
  host: localhost

香港专业教育学院重新安装Ruby,Rails和MySQL的,但仍然得到相同的错误,任何帮助将不胜感激.干杯

解决方法:

您应该在GemFile中调整rake的版本.

Rake 0.9刚出来但打破了Rails.

这是dhh的推文:

昨天发布的Rake 0.9打破了Rails(及其他).当我们等待修复时,您会在Gemfile中需要gem’rake’,’0.8.7′.

试试吧

编辑:另外,如果您确实需要Rake 0.9而不是Rake 0.8.7,请参见that post.也许这种修复对您有用.

标签:ruby,ruby-on-rails,mysql,rake
来源: https://codeday.me/bug/20191013/1905885.html