Ruby on rails AppFog找不到名为';默认值';

Ruby on rails AppFog找不到名为';默认值';,ruby-on-rails,ruby,mongoid,cloud-foundry,appfog,Ruby On Rails,Ruby,Mongoid,Cloud Foundry,Appfog,在我的mongoid.yml我有 production: sessions: default: host: - <%= JSON.parse(ENV['VCAP_SERVICES'])['mongodb-1.8'].first['credentials']['hostname'] rescue 'localhost' %> port: <%= JSON.parse( ENV['VCAP_SERVICES'] )['mongod

在我的mongoid.yml我有

production:
  sessions:
    default:
      host:
        - <%= JSON.parse(ENV['VCAP_SERVICES'])['mongodb-1.8'].first['credentials']['hostname'] rescue 'localhost' %>
      port: <%= JSON.parse( ENV['VCAP_SERVICES'] )['mongodb-1.8'].first['credentials']['port'] rescue 27017 %>
      database:  <%= JSON.parse( ENV['VCAP_SERVICES'] )['mongodb-1.8'].first['credentials']['db'] rescue 'tutorial_db' %>
      username: <%= JSON.parse( ENV['VCAP_SERVICES'] )['mongodb-1.8'].first['credentials']['username'] rescue '' %>
      password: <%= JSON.parse( ENV['VCAP_SERVICES'] )['mongodb-1.8'].first['credentials']['password'] rescue '' %>
正确的键是“主机:”否“主机:”


最近我想到了这一点。服务器在生产模式下运行,所以将其更改为开发模式,然后一切正常。。。
ActionView::Template::Error (
Problem:
  No configuration could be found for a session named 'default'.
Summary:
  When attempting to create the new session, Mongoid could not find a session configuration for the name: 'default'. This is
necessary in order to know the host, port, and options needed to connect.
Resolution:
  Double check your mongoid.yml to make sure under the sessions key that a configuration exists for 'default'. If you have se
t the configuration programatically, ensure that 'default' exists in the configuration hash.):