Search code examples
ruby-on-railssettingslogic

Syntax Error in application.yml File


I am running the command rail s and it displays the following error:

/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)

what is wrong in application.yml?

my config/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: [email protected]
    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: [email protected]
  host: host
  url: http://host

test:
  <<: *defaults

production:
  <<: *defaults

Any help will be appreciated.


Solution

  • This seems to be some indentation issue. The mail_from field needs to be inside the smtp block.

    smtp:
      domain: domain
      login: login
      password: secret
      server: host
      port: 25
      mail_from: [email protected]