migrate 数据库遇到问题
2014-09-20 18:37:27 +08:00
woz24416
在$ 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 条回复
xp0729
2014-09-20 19:23:00 +08:00
有没有完整的错误提示?这样实在看不出来
这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。
https://www.v2ex.com/t/134681
V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。
V2EX is a community of developers, designers and creative people.