耙子中止未定义的方法`每个'

时间:2015-09-08 15:58:00

标签: ruby-on-rails

下午好。 不能处理癌症db:迁移

user @ ubuntu:〜/ furriery / furriery $ rake db:migrate 耙子流产了! 未定义的方法each' for "../.openshift/config/database.yml":String /home/user/.rvm/gems/ruby-2.0.0-p643/gems/activerecord-4.1.4/lib/active_record/connection_adapters/connection_specification.rb:163:in resolve_all&#39; /home/user/.rvm/gems/ruby-2.0.0-p643/gems/activerecord-4.1.4/lib/active_record/connection_handling.rb:69:in resolve' /home/user/.rvm/gems/ruby-2.0.0-p643/gems/activerecord-4.1.4/lib/active_record/core.rb:46:in configurations =&#39; /home/user/.rvm/gems/ruby-2.0.0-p643/gems/activerecord-4.1.4/lib/active_record/railtie.rb:128:in block (2 levels) in <class:Railtie>' /home/user/.rvm/gems/ruby-2.0.0-p643/gems/activesupport-4.1.4/lib/active_support/lazy_load_hooks.rb:38:in instance_eval&#39; /home/user/.rvm/gems/ruby-2.0.0-p643/gems/activesupport-4.1.4/lib/active_support/lazy_load_hooks.rb:38:in execute_hook' /home/user/.rvm/gems/ruby-2.0.0-p643/gems/activesupport-4.1.4/lib/active_support/lazy_load_hooks.rb:28:in阻止on_load&#39; /home/user/.rvm/gems/ruby-2.0.0-p643/gems/activesupport-4.1.4/lib/active_support/lazy_load_hooks.rb:27:in each' /home/user/.rvm/gems/ruby-2.0.0-p643/gems/activesupport-4.1.4/lib/active_support/lazy_load_hooks.rb:27:in on_load&#39; /home/user/.rvm/gems/ruby-2.0.0-p643/gems/activerecord-4.1.4/lib/active_record/railtie.rb:118:in block in <class:Railtie>' /home/user/.rvm/gems/ruby-2.0.0-p643/gems/railties-4.1.4/lib/rails/initializable.rb:30:in instance_exec&#39; run_initializers&#39;中的/home/user/.rvm/gems/ruby-2.0.0-p643/gems/railties-4.1.4/lib/rails/initializable.rb:30:in run' /home/user/.rvm/gems/ruby-2.0.0-p643/gems/railties-4.1.4/lib/rails/initializable.rb:55:in阻止 /home/user/.rvm/gems/ruby-2.0.0-p643/gems/railties-4.1.4/lib/rails/initializable.rb:54:in run_initializers' /home/user/.rvm/gems/ruby-2.0.0-p643/gems/railties-4.1.4/lib/rails/application.rb:300:in初始化!&#39; /home/user/furriery/furriery/config/environment.rb:5:in <top (required)>' /home/user/.rvm/gems/ruby-2.0.0-p643/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:247:in要求&#39; /home/user/.rvm/gems/ruby-2.0.0-p643/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:247:in block in require' /home/user/.rvm/gems/ruby-2.0.0-p643/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:232:in load_dependency&#39; /home/user/.rvm/gems/ruby-2.0.0-p643/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:247:in require' /home/user/.rvm/gems/ruby-2.0.0-p643/gems/railties-4.1.4/lib/rails/application.rb:276:in require_environment!&#39; /home/user/.rvm/gems/ruby-2.0.0-p643/gems/railties-4.1.4/lib/rails/application.rb:379:in block in run_tasks_blocks' /home/user/.rvm/gems/ruby-2.0.0-p643/bin/ruby_executable_hooks:15:in eval&#39; /home/user/.rvm/gems/ruby-2.0.0-p643/bin/ruby_executable_hooks:15:in`' 任务:TOP =&gt; db:migrate =&gt;环境 (通过使用--trace运行任务查看完整跟踪)

ruby​​ 2.0.0p643(2015-02-25修订版49749)[i686-linux] Rails 4.1.4 rvm 1.26.11(最新)作者:Wayne E. Seguin,Michal Papis [https://rvm.io/]

1 个答案:

答案 0 :(得分:1)

检查您的database.yml文件并确保每个&#34;:&#34;分隔符后跟一个空格。还要确保缩进时有空格而不是制表符。您可以在此处查看您的文件以查看其是否为有效的YAML:http://www.yamllint.com/