rake db:schema:dump 在 cmd 中它不会在数据库文件夹中生成 schema.rb 文件

发布于 2024-12-22 06:34:40 字数 4201 浏览 2 评论 0原文

我是 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:inparse_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:in instance_eval' C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-3.1.3/lib/active_support/lazy_ load_hooks.rb:36:inexecute_hook' C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-3.1.3/lib/active_support/lazy_ load_hooks.rb:43:in run_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:ininvoke_with_call_chain 中的块' C:/Ruby192/lib/ruby/1.9.1/monitor.rb:201:in mon_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:ininvoke_with_call_chain 中的块' C:/Ruby192/lib/ruby/1.9.1/monitor.rb:201:in mon_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:ininvoke_task' C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:94:in top_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:in top_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_config

C:\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: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 parse'
C:/Ruby192/lib/ruby/1.9.1/psych.rb:106:in
load'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.1.3/lib/rails/application/configu
ration.rb:106:in database_configuration'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/activerecord-3.1.3/lib/active_record/railtie
.rb:68:in
block (2 levels) in '
C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-3.1.3/lib/active_support/lazy_
load_hooks.rb:36:in instance_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:in block in run_load_hooks'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-3.1.3/lib/active_support/lazy_
load_hooks.rb:42:in
each'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-3.1.3/lib/active_support/lazy_
load_hooks.rb:42:in run_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:in block (2 levels) in <top (required)>'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:205:in
call'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:205:in
block in execute'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:200:in
each'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:200:in
execut e'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:158:in
block in invoke_with_call_chain'
C:/Ruby192/lib/ruby/1.9.1/monitor.rb:201:in mon_synchronize'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:151:in
invoke
_with_call_chain' C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:176:in
block in invoke_prerequisites'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:174:in
each'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:174:in
invoke
_prerequisites' C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:157:in
block in invoke_with_call_chain'
C:/Ruby192/lib/ruby/1.9.1/monitor.rb:201:in mon_synchronize'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:151:in
invoke
_with_call_chain' C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:144:in
invoke '
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:in
block (2 levels) in top_level'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:94:in
each'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:94:in
block in top_level'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:133:in
standard_exception_handling'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:88:in
top_level'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:66:in
block in run'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:133:in
standard_exception_handling'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:63:in
run' 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' Tasks: TOP => db:schema:dump => db:load_config

C:\Users\ACK\SITES\simple_cms>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

御弟哥哥 2024-12-29 06:34:40

确保您的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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文