rake db:schema:dump 在 cmd 中它不会在数据库文件夹中生成 schema.rb 文件
我是 ruby on Rails 新手,当我尝试在 cmd 中运行 rake db:schema:dump
时,它不会在数据库文件夹中生成 schema.rb
文件
C:\Users\ACK\SITES\simple_cms>rake db:schema:dump --trace ** 调用 db:schema:dump (first_time) ** 调用环境(first_time) ** 执行环境 ** 调用 db:load_config (first_time) ** 调用rails_env (first_time) ** 执行rails_env ** 执行 db:load_config rake 中止!无法解析 YAML 第 19 行第 2 列 C:/Ruby192/lib/ruby/1.9.1/psych.rb:148:in
<块引用>parse' C:/Ruby192/lib/ruby/1.9.1/psych.rb:148:in
parse_stream' C:/Ruby192/lib/ruby/1.9.1/psych.rb:119:in解析' C:/Ruby192/lib/ruby/1.9.1/psych.rb:106:in
加载' C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.1.3/lib/rails/application/configu ration.rb:106:在database_configuration' C:/Ruby192/lib/ruby/gems/1.9.1/gems/activerecord-3.1.3/lib/active_record/railtie .rb:68:in
块(2 级) in ' C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-3.1.3/lib/active_support/lazy_ load_hooks.rb:36:ininstance_eval' C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-3.1.3/lib/active_support/lazy_ load_hooks.rb:36:in
execute_hook' C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-3.1.3/lib/active_support/lazy_ load_hooks.rb:43:inrun_load_hooks' 中的块 C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-3.1.3/lib/active_support/lazy_ load_hooks.rb:42:in
每个' C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-3.1.3/lib/active_support/lazy_ load_hooks.rb:42:在run_load_hooks' C:/Ruby192/lib/ruby/gems/1.9.1/gems/activerecord-3.1.3/lib/active_record/base.rb :2190:在
' C:/Ruby192/lib/ruby/gems/1.9.1/gems/activerecord-3.1.3/lib/active_record/railtie s/databases.rake:6:in' 中的 块(2 级) C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:205:in
调用' C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:205:in执行中的块' C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:200:in
每个' C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:200:in执行e' C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:158:in
invoke_with_call_chain 中的块' C:/Ruby192/lib/ruby/1.9.1/monitor.rb:201:inmon_synchronize' C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:151:in
调用 _with_call_chain' C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:176:in调用_先决条件中的块 C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:174:in
每个' C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:174:in调用 _先决条件'C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:157:in
invoke_with_call_chain 中的块' C:/Ruby192/lib/ruby/1.9.1/monitor.rb:201:inmon_synchronize' C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:151:in
调用 _with_call_chain' C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:144:in调用 ' C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:116:in
invoke_task' C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:94:intop_level' 中的块(2 层) C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:94:in
每个' C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:94:in顶级块' C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:133:in
标准异常处理' C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:88:intop_level' C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:66:in
阻止运行' C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:133:in 标准异常处理' C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:63:in 运行'C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/bin/rake:33:in `' C:/Ruby192/bin/rake:19:in
load' C:/Ruby192/bin/rake:19:in
' 任务:TOP =>数据库:架构:转储=>数据库:load_configC:\Users\ACK\SITES\simple_cms>
I m new to ruby on rails when I try to run rake db:schema:dump
in cmd it is not generating schema.rb
file in database folder
C:\Users\ACK\SITES\simple_cms>rake db:schema:dump --trace
** Invoke db:schema:dump (first_time)
** Invoke environment (first_time)
** Execute environment
** Invoke db:load_config (first_time)
** Invoke rails_env (first_time)
** Execute rails_env
** Execute db:load_config rake aborted! couldn't parse YAML at line 19 column 2 C:/Ruby192/lib/ruby/1.9.1/psych.rb:148:inparse'
parse_stream'
C:/Ruby192/lib/ruby/1.9.1/psych.rb:148:in
C:/Ruby192/lib/ruby/1.9.1/psych.rb:119:inparse'
load'
C:/Ruby192/lib/ruby/1.9.1/psych.rb:106:in
C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.1.3/lib/rails/application/configu
ration.rb:106:indatabase_configuration'
block (2 levels) in '
C:/Ruby192/lib/ruby/gems/1.9.1/gems/activerecord-3.1.3/lib/active_record/railtie
.rb:68:in
C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-3.1.3/lib/active_support/lazy_
load_hooks.rb:36:ininstance_eval'
execute_hook'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-3.1.3/lib/active_support/lazy_
load_hooks.rb:36:in
C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-3.1.3/lib/active_support/lazy_
load_hooks.rb:43:inblock in run_load_hooks'
each'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-3.1.3/lib/active_support/lazy_
load_hooks.rb:42:in
C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-3.1.3/lib/active_support/lazy_
load_hooks.rb:42:inrun_load_hooks'
'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/activerecord-3.1.3/lib/active_record/base.rb
:2190:in
C:/Ruby192/lib/ruby/gems/1.9.1/gems/activerecord-3.1.3/lib/active_record/railtie
s/databases.rake:6:inblock (2 levels) in <top (required)>'
call'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:205:in
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:205:inblock in execute'
each'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:200:in
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:200:inexecut e'
block in invoke_with_call_chain'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:158:in
C:/Ruby192/lib/ruby/1.9.1/monitor.rb:201:inmon_synchronize'
invoke
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:151:in
_with_call_chain' C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:176:inblock in invoke_prerequisites'
each'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:174:in
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:174:ininvoke
block in invoke_with_call_chain'
_prerequisites' C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:157:in
C:/Ruby192/lib/ruby/1.9.1/monitor.rb:201:inmon_synchronize'
invoke
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:151:in
_with_call_chain' C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:144:ininvoke '
invoke_task'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:116:in
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:94:inblock (2 levels) in top_level'
each'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:94:in
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:94:inblock in top_level'
standard_exception_handling'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:133:in
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:88:intop_level'
block in run'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:66:in
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:133:instandard_exception_handling'
run' C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/bin/rake:33:in
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:63:in
`' C:/Ruby192/bin/rake:19:in
load' C:/Ruby192/bin/rake:19:in
' Tasks: TOP => db:schema:dump => db:load_configC:\Users\ACK\SITES\simple_cms>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
确保您的database.yml 文件中的密码是字符串,而不是所有数字。例如,321 会引发错误,b321 会起作用。
至少在我撰写本文时(4.21.12),不同的程序更新是异步进行的,并且事情可能会中断,因为它们彼此之间的通信方式不同。
Make sure your password in your database.yml file is a string, as in not all numbers. For example, 321 would pull an error, b321 would work.
At least as my of this writing (4.21.12), different program updates get made asynchronously and things can break since they're talking to each other differently.