V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
woz24416
V2EX  ›  问与答

migrate 数据库遇到问题

  •  
  •   woz24416 · 2014-09-20 18:37:27 +08:00 · 2502 次点击
    这是一个创建于 3510 天前的主题,其中的信息可能已经有所发展或是发生改变。
    在$ rails generate scaffold User name:string email:string这一步之后,在执行bundle exec rake db:migrate这条命令之后,出现如下报错信息:
    rake aborted!
    NoMethodError: undefined method `accept' for nil:NilClass

    使用环境如下:
    系统:OS X 10.9.5
    Ruby: ruby2.0.0p481
    Rails: 4.0.2

    Gemfile相关内容如下:
    gem 'rails', '4.0.2'
    gem 'mysql2', '0.2.6'
    gem 'sass-rails', '4.0.1'
    gem 'uglifier', '2.1.1'
    gem 'coffee-rails', '4.0.1'
    gem 'jquery-rails', '2.2.1'
    gem 'turbolinks', '1.1.1'
    gem 'jbuilder', '1.0.2'
    group :doc do
    # bundle exec rake doc:rails generates the API under doc/api.
    gem 'sdoc', '0.3.20', require: false
    end

    database.yml的内容如下:
    development:
    adapter: mysql2
    encoding: utf8
    database: demo_app_development
    pool: 5
    username: root
    password: rails
    host: 127.0.0.1
    port: 3306

    *** LOCAL GEMS ***

    actionmailer (4.0.2)
    actionpack (4.0.2)
    activemodel (4.0.2)
    activerecord (4.0.2)
    activerecord-deprecated_finders (1.0.3)
    activesupport (4.0.2)
    arel (4.0.2)
    bigdecimal (1.2.0)
    builder (3.1.4)
    bundler (1.6.2)
    bundler-unload (1.0.2)
    coffee-rails (4.0.1)
    coffee-script (2.3.0)
    coffee-script-source (1.8.0)
    erubis (2.7.0)
    execjs (2.2.1)
    executable-hooks (1.3.2)
    gem-wrappers (1.2.4)
    hike (1.2.3)
    i18n (0.7.0.beta1, 0.6.11)
    io-console (0.4.2)
    jbuilder (1.5.3, 1.0.2)
    jquery-rails (3.1.2, 2.2.1)
    json (1.8.1, 1.7.7)
    mail (2.5.4)
    mime-types (1.25.1)
    minitest (4.7.5, 4.3.2)
    multi_json (1.10.1)
    mysql2 (0.3.16, 0.3.11, 0.2.6)
    polyglot (0.3.5)
    psych (2.0.0)
    rack (1.5.2)
    rack-test (0.6.2)
    rails (4.0.2)
    railties (4.0.2)
    rake (10.3.2, 0.9.6)
    rdoc (4.1.2, 4.0.0, 3.12.2)
    rubygems-bundler (1.4.4)
    rvm (1.11.3.9)
    sass (3.4.5, 3.4.4, 3.2.19)
    sass-rails (4.0.3, 4.0.1)
    sdoc (0.4.1, 0.3.20)
    sprockets (2.12.2, 2.11.0)
    sprockets-rails (2.0.1)
    sqlite3 (1.3.9, 1.3.8)
    test-unit (2.0.0.0)
    thor (0.19.1)
    thread_safe (0.3.4)
    tilt (1.4.1)
    treetop (1.4.15)
    turbolinks (2.3.0, 1.1.1)
    tzinfo (0.3.41)
    uglifier (2.5.3, 2.1.1)

    恳请得到诸位的帮助,万分感谢!!!
    1 条回复    2014-09-20 19:23:00 +08:00
    xp0729
        1
    xp0729  
       2014-09-20 19:23:00 +08:00
    有没有完整的错误提示?这样实在看不出来
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2274 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 22ms · UTC 10:02 · PVG 18:02 · LAX 03:02 · JFK 06:02
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.