0

我正在运行命令 rail s,它显示以下错误:

/home/user/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/settingslogic-2.0.9/lib/settingslogic.rb:189:in `missing_key': Missing setting 'mail_from' in /home/user/myapp/my_app/config/application.yml (Settingslogic::MissingSetting)

application.yml 有什么问题?

我的配置/application.yml

 defaults: &defaults
    site_name: site
    host: site
    url: site
    resque:
      server: 127.0.0.1:6379
      namespace: resque_namespace
    smtp:
      domain: domain
      login: login
      password: secret
      server: host
      port: 25
    mail_from: mail@example.com
    robokassa:
      login: login
      test_mode: false
      pass1: secret
      pass2: secret
      token: secret
    avisosms:
      login: login
      service_id: 666
      hash: secret
    sdpays:
      md5: secret
      project_id: 666
    edit_delay: 5
    contest_id: 1
    aws:
      ses:
        access_key_id: secret
        secret_access_key: secret
      s3:
        access_key_id: secret
        secret_access_key: secret
        bucket: bucket
        fog_directory: dir
    s3cmd: /usr/bin/s3cmd
    vk:
      key: key
      secret: secret
    recaptcha:
      public_key: key
      private_key: private_key

development:
  #<<: *defaults
  host: 'localhost:3666'
  url: 'http://localhost:3666'
  resque:
    server: '127.0.0.1:6379'
    namespace: 'bdsmg_development_resque'
  aws:
    ses:
      access_key_id: key
      secret_access_key: secret
    s3:
      access_key_id: key
      secret_access_key: secret
      bucket: bucket
      fog_directory: dir
  s3cmd: /usr/local/bin/s3cmd

staging:
  <<: *defaults
  test_email: mail@example.com
  host: host
  url: http://host

test:
  <<: *defaults

production:
  <<: *defaults

任何帮助将不胜感激。

4

1 回答 1

2

这似乎是一些缩进问题。mail_from 字段需要在 smtp 块内。

smtp:
  domain: domain
  login: login
  password: secret
  server: host
  port: 25
  mail_from: mail@example.com
于 2015-07-14T14:55:40.147 回答