2011-08-05 43 views
1

自從最近6個月以來,我一直在使用Rubymine 3.1.1和rails 3.0.6。 我剛剛開始使用Ruby的Ruby 3.2.3和MySQL的rails'3.1.0.rc5'。數據庫問題:在rails 3.1中使用mysql遷移

剛拿到手,上軌的新版本中,我試圖創造單支架一個示例應用程序(用戶名:字符串密碼:字符串),但它給出了分貝以下錯誤:遷移: -

== CreateUsers: migrating ==================================================== 
-- create_table(:users) 
rake aborted! 
An error has occurred, all later migrations canceled: 

undefined method `rows' for nil:NilClass 

Tasks: TOP => db:migrate 
(See full trace by running task with --trace) 
    -> 0.1100s 
== CreateUsers: migrated (0.1100s) =========================================== 


Process finished with exit code 1 

有什麼建議?

在此先感謝!

==== List of gems (Gemfile.lock) ==== 

GEM 
    remote: http://rubygems.org/ 
    specs: 
    actionmailer (3.1.0.rc5) 
     actionpack (= 3.1.0.rc5) 
     mail (~> 2.3.0) 
    actionpack (3.1.0.rc5) 
     activemodel (= 3.1.0.rc5) 
     activesupport (= 3.1.0.rc5) 
     builder (~> 3.0.0) 
     erubis (~> 2.7.0) 
     i18n (~> 0.6) 
     rack (~> 1.3.1) 
     rack-cache (~> 1.0.2) 
     rack-mount (~> 0.8.1) 
     rack-test (~> 0.6.0) 
     sprockets (~> 2.0.0.beta.12) 
    activemodel (3.1.0.rc5) 
     activesupport (= 3.1.0.rc5) 
     bcrypt-ruby (~> 2.1.4) 
     builder (~> 3.0.0) 
     i18n (~> 0.6) 
    activerecord (3.1.0.rc5) 
     activemodel (= 3.1.0.rc5) 
     activesupport (= 3.1.0.rc5) 
     arel (~> 2.1.4) 
     tzinfo (~> 0.3.29) 
    activeresource (3.1.0.rc5) 
     activemodel (= 3.1.0.rc5) 
     activesupport (= 3.1.0.rc5) 
    activesupport (3.1.0.rc5) 
     multi_json (~> 1.0) 
    ansi (1.3.0) 
    arel (2.1.4) 
    bcrypt-ruby (2.1.4-x86-mingw32) 
    builder (3.0.0) 
    coffee-rails (3.1.0.rc.5) 
     actionpack (~> 3.1.0.rc1) 
     coffee-script (>= 2.2.0) 
     railties (~> 3.1.0.rc1) 
     sprockets (>= 2.0.0.beta.9) 
    coffee-script (2.2.0) 
     coffee-script-source 
     execjs 
    coffee-script-source (1.1.2) 
    erubis (2.7.0) 
    execjs (1.2.4) 
     multi_json (~> 1.0) 
    hike (1.2.0) 
    i18n (0.6.0) 
    jquery-rails (1.0.12) 
     railties (~> 3.0) 
     thor (~> 0.14) 
    mail (2.3.0) 
     i18n (>= 0.4.0) 
     mime-types (~> 1.16) 
     treetop (~> 1.4.8) 
    mime-types (1.16) 
    multi_json (1.0.3) 
    mysql2 (0.2.6-x86-mingw32) 
    polyglot (0.3.2) 
    rack (1.3.2) 
    rack-cache (1.0.2) 
     rack (>= 0.4) 
    rack-mount (0.8.1) 
     rack (>= 1.0.0) 
    rack-ssl (1.3.2) 
     rack 
    rack-test (0.6.1) 
     rack (>= 1.0) 
    rails (3.1.0.rc5) 
     actionmailer (= 3.1.0.rc5) 
     actionpack (= 3.1.0.rc5) 
     activerecord (= 3.1.0.rc5) 
     activeresource (= 3.1.0.rc5) 
     activesupport (= 3.1.0.rc5) 
     bundler (~> 1.0) 
     railties (= 3.1.0.rc5) 
    railties (3.1.0.rc5) 
     actionpack (= 3.1.0.rc5) 
     activesupport (= 3.1.0.rc5) 
     rack-ssl (~> 1.3.2) 
     rake (>= 0.8.7) 
     rdoc (~> 3.4) 
     thor (~> 0.14.6) 
    rake (0.9.2) 
    rdoc (3.9.1) 
    sass (3.1.7) 
    sass-rails (3.1.0.rc.5) 
     actionpack (~> 3.1.0.rc1) 
     railties (~> 3.1.0.rc1) 
     sass (>= 3.1.4) 
     sprockets (>= 2.0.0.beta.9) 
    sprockets (2.0.0.beta.13) 
     hike (~> 1.2) 
     rack (~> 1.0) 
     tilt (~> 1.1, != 1.3.0) 
    thor (0.14.6) 
    tilt (1.3.2) 
    treetop (1.4.10) 
     polyglot 
     polyglot (>= 0.3.1) 
    turn (0.8.2) 
     ansi (>= 1.2.2) 
    tzinfo (0.3.29) 
    uglifier (1.0.0) 
     execjs (>= 0.3.0) 
     multi_json (>= 1.0.2) 

PLATFORMS 
    x86-mingw32 

DEPENDENCIES 
    coffee-rails (~> 3.1.0.rc) 
    jquery-rails 
    mysql2 
    rails (= 3.1.0.rc5) 
    sass-rails (~> 3.1.0.rc) 
    turn 
    uglifier 


=== gem environment === 
RubyGems Environment: 
    - RUBYGEMS VERSION: 1.3.7 
    - RUBY VERSION: 1.9.2 (2010-08-18 patchlevel 0) [i386-mingw32] 
    - INSTALLATION DIRECTORY: C:/Ruby192/lib/ruby/gems/1.9.1 
    - RUBY EXECUTABLE: C:/Ruby192/bin/ruby.exe 
    - EXECUTABLE DIRECTORY: C:/Ruby192/bin 
    - RUBYGEMS PLATFORMS: 
    - ruby 
    - x86-mingw32 
    - GEM PATHS: 
    - C:/Ruby192/lib/ruby/gems/1.9.1 
    - C:/Users/rashmi/.gem/ruby/1.9.1 
    - GEM CONFIGURATION: 
    - :update_sources => true 
    - :verbose => true 
    - :benchmark => false 
    - :backtrace => false 
    - :bulk_threshold => 1000 
    - REMOTE SOURCES: 
    - http://rubygems.org/ 
+0

也許你需要提供更多的詳細信息,如寶石的這個項目與版本列表(Gemfile.lock的) MySQL gem的配置塊,'gem list'和'gem environment'命令的輸出。 – CrazyCoder

+0

@CrazyCoder:已經發布了上面的寶石列表和寶石環境.. – Rashmi

回答

1

我使用的是Mac OS X Lion的解決方案是:

On Gemfile: 
Just replace the old version of mysql for this one: 

    gem 'mysql2', '0.3.7'