Ruby on rails ruby on rails与postgres db的集成

Ruby on rails ruby on rails与postgres db的集成,ruby-on-rails,ruby,postgresql,Ruby On Rails,Ruby,Postgresql,我是RubyonRails新手,我正在尝试开发一些演示应用程序。我正在尝试使用postgres作为数据库服务器。我正在尝试使用rakedb:setup命令从rails设置数据库。我得到以下例外。我使用谷歌进行了研究,但用我的一点知识无法解决问题。你能帮我解决这个问题吗 Ruby版本2.2.2和rails版本4.2.1 以下是例外情况: $ bin/rake db:setup /home/satish/.rbenv/versions/2.2.2/lib/ruby/2.2.0/psych/visit

我是RubyonRails新手,我正在尝试开发一些演示应用程序。我正在尝试使用postgres作为数据库服务器。我正在尝试使用
rakedb:setup
命令从rails设置数据库。我得到以下例外。我使用谷歌进行了研究,但用我的一点知识无法解决问题。你能帮我解决这个问题吗

Ruby版本2.2.2和rails版本4.2.1

以下是例外情况:

$ bin/rake db:setup
/home/satish/.rbenv/versions/2.2.2/lib/ruby/2.2.0/psych/visitors/to_ruby.rb:303:in `block in visit_Psych_Nodes_Alias': Cannot load `Rails.application.database_configuration`:
Unknown alias: default (Psych::BadAlias)
        from /home/satish/.rbenv/versions/2.2.2/lib/ruby/2.2.0/psych/visitors/to_ruby.rb:303:in `fetch'
        from /home/satish/.rbenv/versions/2.2.2/lib/ruby/2.2.0/psych/visitors/to_ruby.rb:303:in `visit_Psych_Nodes_Alias'
        from /home/satish/.rbenv/versions/2.2.2/lib/ruby/2.2.0/psych/visitors/visitor.rb:15:in `visit'
        from /home/satish/.rbenv/versions/2.2.2/lib/ruby/2.2.0/psych/visitors/visitor.rb:5:in `accept'
        from /home/satish/.rbenv/versions/2.2.2/lib/ruby/2.2.0/psych/visitors/to_ruby.rb:31:in `accept'
        from /home/satish/.rbenv/versions/2.2.2/lib/ruby/2.2.0/psych/visitors/to_ruby.rb:321:in `block in revive_hash'
        from /home/satish/.rbenv/versions/2.2.2/lib/ruby/2.2.0/psych/visitors/to_ruby.rb:319:in `each'
        from /home/satish/.rbenv/versions/2.2.2/lib/ruby/2.2.0/psych/visitors/to_ruby.rb:319:in `each_slice'
        from /home/satish/.rbenv/versions/2.2.2/lib/ruby/2.2.0/psych/visitors/to_ruby.rb:319:in `revive_hash'
        from /home/satish/.rbenv/versions/2.2.2/lib/ruby/2.2.0/psych/visitors/to_ruby.rb:161:in `visit_Psych_Nodes_Mapping'
        from /home/satish/.rbenv/versions/2.2.2/lib/ruby/2.2.0/psych/visitors/visitor.rb:15:in `visit'
        from /home/satish/.rbenv/versions/2.2.2/lib/ruby/2.2.0/psych/visitors/visitor.rb:5:in `accept'
        from /home/satish/.rbenv/versions/2.2.2/lib/ruby/2.2.0/psych/visitors/to_ruby.rb:31:in `accept'
        from /home/satish/.rbenv/versions/2.2.2/lib/ruby/2.2.0/psych/visitors/to_ruby.rb:321:in `block in revive_hash'
        from /home/satish/.rbenv/versions/2.2.2/lib/ruby/2.2.0/psych/visitors/to_ruby.rb:319:in `each'
        from /home/satish/.rbenv/versions/2.2.2/lib/ruby/2.2.0/psych/visitors/to_ruby.rb:319:in `each_slice'
        from /home/satish/.rbenv/versions/2.2.2/lib/ruby/2.2.0/psych/visitors/to_ruby.rb:319:in `revive_hash'
        from /home/satish/.rbenv/versions/2.2.2/lib/ruby/2.2.0/psych/visitors/to_ruby.rb:161:in `visit_Psych_Nodes_Mapping'
        from /home/satish/.rbenv/versions/2.2.2/lib/ruby/2.2.0/psych/visitors/visitor.rb:15:in `visit'
        from /home/satish/.rbenv/versions/2.2.2/lib/ruby/2.2.0/psych/visitors/visitor.rb:5:in `accept'
        from /home/satish/.rbenv/versions/2.2.2/lib/ruby/2.2.0/psych/visitors/to_ruby.rb:31:in `accept'
        from /home/satish/.rbenv/versions/2.2.2/lib/ruby/2.2.0/psych/visitors/to_ruby.rb:295:in `visit_Psych_Nodes_Document'
        from /home/satish/.rbenv/versions/2.2.2/lib/ruby/2.2.0/psych/visitors/visitor.rb:15:in `visit'
        from /home/satish/.rbenv/versions/2.2.2/lib/ruby/2.2.0/psych/visitors/visitor.rb:5:in `accept'
        from /home/satish/.rbenv/versions/2.2.2/lib/ruby/2.2.0/psych/visitors/to_ruby.rb:31:in `accept'
        from /home/satish/.rbenv/versions/2.2.2/lib/ruby/2.2.0/psych/nodes/node.rb:37:in `to_ruby'
        from /home/satish/.rbenv/versions/2.2.2/lib/ruby/2.2.0/psych.rb:246:in `load'
        from /home/satish/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/application/configuration.rb:104:in `database_configuration'
        from /home/satish/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activerecord-4.2.1/lib/active_record/railtie.rb:117:in `block (2 levels) in <class:Railtie>'
        from /home/satish/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activesupport-4.2.1/lib/active_support/lazy_load_hooks.rb:38:in `instance_eval'
        from /home/satish/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activesupport-4.2.1/lib/active_support/lazy_load_hooks.rb:38:in `execute_hook'
        from /home/satish/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activesupport-4.2.1/lib/active_support/lazy_load_hooks.rb:45:in `block in run_load_hooks'
        from /home/satish/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activesupport-4.2.1/lib/active_support/lazy_load_hooks.rb:44:in `each'
        from /home/satish/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activesupport-4.2.1/lib/active_support/lazy_load_hooks.rb:44:in `run_load_hooks'
        from /home/satish/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activerecord-4.2.1/lib/active_record/base.rb:316:in `<module:ActiveRecord>'
        from /home/satish/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activerecord-4.2.1/lib/active_record/base.rb:26:in `<top (required)>'
        from /home/satish/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/spring-1.3.6/lib/spring/application.rb:319:in `active_record_configured?'
        from /home/satish/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/spring-1.3.6/lib/spring/application.rb:251:in `disconnect_database'
        from /home/satish/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/spring-1.3.6/lib/spring/application.rb:97:in `preload'
        from /home/satish/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/spring-1.3.6/lib/spring/application.rb:143:in `serve'
        from /home/satish/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/spring-1.3.6/lib/spring/application.rb:131:in `block in run'
        from /home/satish/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/spring-1.3.6/lib/spring/application.rb:125:in `loop'
        from /home/satish/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/spring-1.3.6/lib/spring/application.rb:125:in `run'
        from /home/satish/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/spring-1.3.6/lib/spring/application/boot.rb:18:in `<top (required)>'
        from /home/satish/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
        from /home/satish/.rbenv/versions/2.2.2/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
        from -e:1:in `<main>'
$bin/rake数据库:设置
/home/satish/.rbenv/versions/2.2.2/lib/ruby/2.2.0/psych/visitors/to_ruby.rb:303:在'block in visit_psych_Nodes_Alias'中:无法加载'Rails.application.database_configuration':
未知别名:默认值(Psych::BadAlias)
from/home/satish/.rbenv/versions/2.2.2/lib/ruby/2.2.0/psych/visitors/to_ruby.rb:303:in'fetch'
from/home/satish/.rbenv/versions/2.2.2/lib/ruby/2.2.0/psych/visitors/to_ruby.rb:303:in'visit_psych_Nodes_Alias'
from/home/satish/.rbenv/versions/2.2.2/lib/ruby/2.2.0/psych/visitors/visitor.rb:15:in'visit'
from/home/satish/.rbenv/versions/2.2.2/lib/ruby/2.2.0/psych/visitors/visitor.rb:5:in'accept'
from/home/satish/.rbenv/versions/2.2.2/lib/ruby/2.2.0/psych/visitors/to_ruby.rb:31:in'accept'
from/home/satish/.rbenv/versions/2.2.2/lib/ruby/2.2.0/psych/visitors/to_ruby.rb:321:in'block in resove_hash'
from/home/satish/.rbenv/versions/2.2.2/lib/ruby/2.2.0/psych/visitors/to_ruby.rb:319:in'each'
from/home/satish/.rbenv/versions/2.2.2/lib/ruby/2.2.0/psych/visitors/to_ruby.rb:319:in'each_slice'
from/home/satish/.rbenv/versions/2.2.2/lib/ruby/2.2.0/psych/visitors/to_ruby.rb:319:in'reserve_hash'
from/home/satish/.rbenv/versions/2.2.2/lib/ruby/2.2.0/psych/visitors/to_ruby.rb:161:in'visit_psych_Nodes_Mapping'
from/home/satish/.rbenv/versions/2.2.2/lib/ruby/2.2.0/psych/visitors/visitor.rb:15:in'visit'
from/home/satish/.rbenv/versions/2.2.2/lib/ruby/2.2.0/psych/visitors/visitor.rb:5:in'accept'
from/home/satish/.rbenv/versions/2.2.2/lib/ruby/2.2.0/psych/visitors/to_ruby.rb:31:in'accept'
from/home/satish/.rbenv/versions/2.2.2/lib/ruby/2.2.0/psych/visitors/to_ruby.rb:321:in'block in resove_hash'
from/home/satish/.rbenv/versions/2.2.2/lib/ruby/2.2.0/psych/visitors/to_ruby.rb:319:in'each'
from/home/satish/.rbenv/versions/2.2.2/lib/ruby/2.2.0/psych/visitors/to_ruby.rb:319:in'each_slice'
from/home/satish/.rbenv/versions/2.2.2/lib/ruby/2.2.0/psych/visitors/to_ruby.rb:319:in'reserve_hash'
from/home/satish/.rbenv/versions/2.2.2/lib/ruby/2.2.0/psych/visitors/to_ruby.rb:161:in'visit_psych_Nodes_Mapping'
from/home/satish/.rbenv/versions/2.2.2/lib/ruby/2.2.0/psych/visitors/visitor.rb:15:in'visit'
from/home/satish/.rbenv/versions/2.2.2/lib/ruby/2.2.0/psych/visitors/visitor.rb:5:in'accept'
from/home/satish/.rbenv/versions/2.2.2/lib/ruby/2.2.0/psych/visitors/to_ruby.rb:31:in'accept'
from/home/satish/.rbenv/versions/2.2.2/lib/ruby/2.2.0/psych/visitors/to_ruby.rb:295:in'visit_psych_Nodes_Document'
from/home/satish/.rbenv/versions/2.2.2/lib/ruby/2.2.0/psych/visitors/visitor.rb:15:in'visit'
from/home/satish/.rbenv/versions/2.2.2/lib/ruby/2.2.0/psych/visitors/visitor.rb:5:in'accept'
from/home/satish/.rbenv/versions/2.2.2/lib/ruby/2.2.0/psych/visitors/to_ruby.rb:31:in'accept'
from/home/satish/.rbenv/versions/2.2.2/lib/ruby/2.2.0/psych/nodes/node.rb:37:in'to_ruby'
from/home/satish/.rbenv/versions/2.2.2/lib/ruby/2.2.0/psych.rb:246:in'load'
from/home/satish/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/application/configuration.rb:104:在“数据库配置”中
from/home/satish/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activerecord-4.2.1/lib/active\u record/railtie.rb:117:in `块(2层)in'
from/home/satish/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activesupport-4.2.1/lib/active\u-support/lazy\u-load\u-hooks.rb:38:in'instance\u-eval'
from/home/satish/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activesupport-4.2.1/lib/active\u-support/lazy\u-load\u-hooks.rb:38:in'execute\u-hook'
from/home/satish/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activesupport-4.2.1/lib/active\u-support/lazy\u-load\u-hooks.rb:45:in'block in-in-run\u-load\u-hooks'
from/home/satish/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activesupport-4.2.1/lib/active\u support/lazy\u load\u hooks.rb:44:在'each'中
来自/home/satish/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activesupport-4.2.1/lib/active\u-support/lazy\u-load\u-hooks.rb:44:in'run\u-load\u-hooks'
from/home/satish/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activerecord-4.2.1/lib/active\u record/base.rb:316:in`'
from/home/satish/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/activerecord-4.2.1/lib/active\u record/base.rb:26:in`'
from/home/satish/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/spring-1.3.6/lib/spring/application.rb:319:在“活动记录配置”中
from/home/satish/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/spring-1.3.6/lib/spring/application.rb:251:“断开与数据库的连接”
from/home/satish/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/spring-1.3.6/lib/spring/application.rb:97:在“预加载”中
from/home/satish/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/spring-1.3.6/lib/spring/application.rb:143:in'serve'
from/home/satish/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/spring-1.3.6/lib/spring/application.rb:131:在“运行中的块”中
from/home/satish/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/spring-1.3.6/lib/spring/application.rb:125:在“循环”中
from/home/satish/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/spring-1.3.6/lib/spring/application.rb:125:在“运行”中
from/home/satish/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/g