2012-11-13 52 views
2

我很難找到解決這個問題的方法。我發現了錯誤:如何解決請安裝mysql適配器:`gem install activerecord-mysql-adapter`(不需要這樣的文件加載-java)

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) 

我試圖卸載耙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) 

這裏是寶石ENV輸出:

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/[email protected] 
    - GEM CONFIGURATION: 
    - :update_sources => true 
    - :verbose => true 
    - :benchmark => false 
    - :backtrace => false 
    - :bulk_threshold => 1000 
    - REMOTE SOURCES: 
    - http://rubygems.org/ 

回答

0

也許這是因爲創業板mysql2的版本,編輯Gemfile

gem "mysql2", "0.2.6" 

而且運行軟件包安裝並再次運行遷移。

+0

日Thnx 4回答,餘did't,而是採取下一個錯誤:耙分貝:遷移 (在/home/EXPRESS.LOCAL/shevchenko/web/tmp) 棄用警告:Rake任務,在供應商/插件/回形針/任務和供應商/插件/平靜認證/任務已棄用。改用lib /任務。 (從/home/EXPRESS.LOCAL/shevchenko/.rvm/gems/ruby-1.8.7-p371/gems/rails-2.3.8/lib/tasks/rails.rb:10調用) rake中止! 未定義的方法'ping'for# (請參閱完整跟蹤通過運行帶有--trace的任務) – cybern0va

+0

@ cybern0va但您的數據庫已遷移或不? – Thanh

+0

沒有。但我更新mysql2到最新版本和我的數據庫遷移,但我收到錯誤:警告:此版本的mysql2(0.3.11)不附帶ActiveRecord適配器捆綁了,因爲它現在是Rails 3.1的一部分 警告:如果您打算在Rails中使用它,請使用0.2.x版本<= 3.0.x PS對不起4我的英語:) – cybern0va

相關問題