2

我很难找到解决这个问题的方法。我收到错误:

rake db:migrate
(in /home/EXPRESS.LOCAL/shevchenko/web/tmp)
DEPRECATION WARNING: Rake tasks in vendor/plugins/paperclip/tasks and vendor/plugins/restful-authentication/tasks are deprecated. Use lib/tasks instead. (called from /home/EXPRESS.LOCAL/shevchenko/.rvm/gems/ruby-1.8.7-p371/gems/rails-2.3.8/lib/tasks/rails.rb:10)
rake aborted!
Please install the mysql2 adapter: `gem install activerecord-mysql2-adapter` (no such file to load -- java)

我正在尝试卸载 rake 0.9.2.2 并安装 0.8.7,然后将适配器:mysql 更改为适配器:mysql2。

这是我的宝石:

bundle show
Gems included by the bundle:
  * actionmailer (2.3.8)
  * actionpack (2.3.8)
  * activerecord (2.3.8)
  * activerecord-jdbc-adapter (1.2.2.1)
  * activerecord-jdbcmysql-adapter (1.2.2.1)
  * activeresource (2.3.8)
  * activesupport (2.3.8)
  * bundler (1.2.1)
  * jdbc-mysql (5.1.13)
  * mysql2 (0.3.6)
  * rack (1.1.3)
  * rails (2.3.8)
  * rake (0.8.7)

这是 gem 环境输出:

RubyGems Environment:
  - RUBYGEMS VERSION: 1.4.2
  - RUBY VERSION: 1.8.7 (2012-10-12 patchlevel 371) [i686-linux]
  - INSTALLATION DIRECTORY: /home/EXPRESS.LOCAL/shevchenko/.rvm/gems/ruby-1.8.7-p371
  - RUBY EXECUTABLE: /home/EXPRESS.LOCAL/shevchenko/.rvm/rubies/ruby-1.8.7-p371/bin/ruby
  - EXECUTABLE DIRECTORY: /home/EXPRESS.LOCAL/shevchenko/.rvm/gems/ruby-1.8.7-p371/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86-linux
  - GEM PATHS:
     - /home/EXPRESS.LOCAL/shevchenko/.rvm/gems/ruby-1.8.7-p371
     - /home/EXPRESS.LOCAL/shevchenko/.rvm/gems/ruby-1.8.7-p371@global
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
     - REMOTE SOURCES:
     - http://rubygems.org/
4

1 回答 1

0

也许这是因为 gem 的版本mysql2,请编辑您的Gemfile

gem "mysql2", "0.2.6"

并运行 bundle install 并再次运行 migrate。

于 2012-11-13T11:55:23.097 回答