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

时间:2011-12-22 13:31:39

标签: schema rake

当我尝试在cmd中运行rake db:schema:dump时,我在轨道上新建了ruby它在数据库文件夹中没有生成schema.rb文件

  

C:\ Users \ ACK \ SITES \ simple_cms&gt; 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 aborted!无法在第19行第2列C解析YAML:/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:在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:在database_configuration' C:/Ruby192/lib/ruby/gems/1.9.1/gems/activerecord-3.1.3/lib/active_record/railtie .rb:68:in块(2级)中'   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: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每个'   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:在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 调用'   C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/task.rb:205:在   block in execute' 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:在   invoke_with_call_chain'execut e' 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:在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   block in invoke_prerequisites' 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:在   invoke_with_call_chain'invoke _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:在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   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:在   每个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   C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:94:在   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:在   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:   standard_exception_handling' 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 =&gt; db:schema:dump =&gt;分贝:load_config

  
     

C:\用户\ ACK \网站\ simple_cms&GT;

1 个答案:

答案 0 :(得分:1)

确保您的database.yml文件中的密码是一个字符串,而不是所有数字。例如,321会引发错误,b321会起作用。

至少在撰写本文时(4.21.12),不同的程序更新是异步进行的,因为它们以不同方式相互交谈,所以事情可能会中断。