开发者

Problem with db:migrate in rails 3.1 with mysql

开发者 https://www.devze.com 2023-03-25 22:16 出处:网络
I have been working with Rubymine 3.1.1 with rails 3.0.6 since last 6 months. I have just started working with rails \'3.1.0.rc5\' with RubyMine 3.2.3 and mysql.

I have been working with Rubymine 3.1.1 with rails 3.0.6 since last 6 months. I have just started working with rails '3.1.0.rc5' with RubyMine 3.2.3 and mysql.

Just to get hands-on with the new version of rails, I tried creating a sample application with single scaffold (User username:string password:string), but it gives the following error on db:migrate :-

==  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

Any suggestions??

Thanks in advance!

==== 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)
  开发者_StackOverflow    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/


I'm using mac OS X Lion the solution was:

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

    gem 'mysql2', '0.3.7'
0

精彩评论

暂无评论...
验证码 换一张
取 消