rake在使用gem'mysql2'时被中止,'< 0.3'

时间:2015-06-02 11:10:58

标签: ruby-on-rails

你好我的宝石文件

gem 'rails', '3.0.5'

gem 'mysql2', '< 0.3'

并在我的database.yml中编写了这段代码

development:
  adapter: mysql2
  encoding: utf8
  pool: 5
  database: railsquiz
  timeout: 5000
  username: root
  password: test
  socket: /var/run/mysqld/mysqld.sock

现在我已经运行了bundle install并获得了这个版本的mysql2-0.2.24。 在做什么时

rake db:create

它给我错误

rake aborted!
ERROR: 'rake/rdoctask' is obsolete and no longer supported. Use 'rdoc/task' (available in RDoc 2.4.2+) instead.
/home/.rvm/gems/ruby-1.9.3-p551@rails-quiz/gems/railties-3.0.5/lib/rails/tasks/documentation.rake:1:in `require'
/home/.rvm/gems/ruby-1.9.3-p551@rails-quiz/gems/railties-3.0.5/lib/rails/tasks/documentation.rake:1:in `<top (required)>'
/home/.rvm/gems/ruby-1.9.3-p551@rails-quiz/gems/railties-3.0.5/lib/rails/tasks.rb:15:in `load'
/home/.rvm/gems/ruby-1.9.3-p551@rails-quiz/gems/railties-3.0.5/lib/rails/tasks.rb:15:in `block in <top (required)>'
/home/.rvm/gems/ruby-1.9.3-p551@rails-quiz/gems/railties-3.0.5/lib/rails/tasks.rb:6:in `each'
/home/.rvm/gems/ruby-1.9.3-p551@rails-quiz/gems/railties-3.0.5/lib/rails/tasks.rb:6:in `<top (required)>'
/home/.rvm/gems/ruby-1.9.3-p551@rails-quiz/gems/railties-3.0.5/lib/rails/application.rb:213:in `require'
/home/.rvm/gems/ruby-1.9.3-p551@rails-quiz/gems/railties-3.0.5/lib/rails/application.rb:213:in `initialize_tasks'
/home/.rvm/gems/ruby-1.9.3-p551@rails-quiz/gems/railties-3.0.5/lib/rails/application.rb:139:in `load_tasks'
/home/.rvm/gems/ruby-1.9.3-p551@rails-quiz/gems/railties-3.0.5/lib/rails/application.rb:77:in `method_missing'
/home/Desktop/clones/railsquiz/Rakefile:7:in `<top (required)>'
/home/.rvm/gems/ruby-1.9.3-p551@rails-quiz/bin/ruby_executable_hooks:15:in `eval'
/home/.rvm/gems/ruby-1.9.3-p551@rails-quiz/bin/ruby_executable_hooks:15:in `<main>'
(See full trace by running task with --trace)

现在请指导如何解决这个问题。提前谢谢。

2 个答案:

答案 0 :(得分:1)

试试这个

gem 'rake', '0.9.2.2'

在您的Gemfile中,然后以

运行rake
bundle exec rake db:migrate

答案 1 :(得分:0)

尝试运行

bundle exec rake db:create