title: Rails 4.1 secrets.yml error
body: <p>Just upgraded to Rails 4.1 and am using <code>secrets.yml</code>.</p>
  
  <p>This is what it looks like:</p>
  
  <pre><code>development:
      secret_key_base: akshdakjshdgakjhsdgakjdhgaskjdhgaskjdhgska
  
  test:
      secret_key_base: somelegitlongasskeygeneratedbyrakesecrethere    
  production:
      secret_key_base: &lt;%= ENV["SECRET_KEY_BASE"] %&gt;
  </code></pre>
  
  <p>When I restart my server and visit any page, in my browser I get an "Internal Server Error".</p>
  
  <p>In my log file, I see this:</p>
  
  <pre><code>$ rails s
  =&gt; Booting Thin
  =&gt; Rails 4.1.0 application starting in development on http://0.0.0.0:3000
  =&gt; Run `rails server -h` for more startup options
  =&gt; Notice: server is listening on all interfaces (0.0.0.0). Consider using 127.0.0.1 (--binding option)
  =&gt; Ctrl-C to shutdown server
  Thin web server (v1.6.2 codename Doc Brown)
  Maximum connections set to 1024
  Listening on 0.0.0.0:3000, CTRL+C to stop
  Unexpected error while processing request: (&lt;unknown&gt;): found character that cannot start any token while scanning for the next token at line 14 column 1
      /.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/psych.rb:205:in `parse'
      /.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/psych.rb:205:in `parse_stream'
      /.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/psych.rb:153:in `parse'
      /.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/psych.rb:129:in `load'
      /.rvm/gems/ruby-2.0.0-p353@my_project/gems/safe_yaml-1.0.3/lib/safe_yaml.rb:15:in `load_with_options'
      /.rvm/gems/ruby-2.0.0-p353@my_project/gems/railties-4.1.0/lib/rails/application.rb:313:in `secrets'
      /.rvm/gems/ruby-2.0.0-p353@my_project/gems/railties-4.1.0/lib/rails/application.rb:439:in `validate_secret_key_config!'
      /.rvm/gems/ruby-2.0.0-p353@my_project/gems/railties-4.1.0/lib/rails/application.rb:195:in `env_config'
      /.rvm/gems/ruby-2.0.0-p353@my_project/gems/railties-4.1.0/lib/rails/engine.rb:510:in `call'
      /.rvm/gems/ruby-2.0.0-p353@my_project/gems/railties-4.1.0/lib/rails/application.rb:144:in `call'
      /.rvm/gems/ruby-2.0.0-p353@global/gems/rack-1.5.2/lib/rack/content_length.rb:14:in `call'
      /.rvm/gems/ruby-2.0.0-p353@my_project/gems/thin-1.6.2/lib/thin/connection.rb:86:in `block in pre_process'
      /.rvm/gems/ruby-2.0.0-p353@my_project/gems/thin-1.6.2/lib/thin/connection.rb:84:in `catch'
      /.rvm/gems/ruby-2.0.0-p353@my_project/gems/thin-1.6.2/lib/thin/connection.rb:84:in `pre_process'
      /.rvm/gems/ruby-2.0.0-p353@my_project/gems/thin-1.6.2/lib/thin/connection.rb:53:in `process'
      /.rvm/gems/ruby-2.0.0-p353@my_project/gems/thin-1.6.2/lib/thin/connection.rb:39:in `receive_data'
      /.rvm/gems/ruby-2.0.0-p353@my_project/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in `run_machine'
      /.rvm/gems/ruby-2.0.0-p353@my_project/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in `run'
      /.rvm/gems/ruby-2.0.0-p353@my_project/gems/thin-1.6.2/lib/thin/backends/base.rb:73:in `start'
      /.rvm/gems/ruby-2.0.0-p353@my_project/gems/thin-1.6.2/lib/thin/server.rb:162:in `start'
      /.rvm/gems/ruby-2.0.0-p353@global/gems/rack-1.5.2/lib/rack/handler/thin.rb:16:in `run'
      /.rvm/gems/ruby-2.0.0-p353@global/gems/rack-1.5.2/lib/rack/server.rb:264:in `start'
      /.rvm/gems/ruby-2.0.0-p353@my_project/gems/railties-4.1.0/lib/rails/commands/server.rb:69:in `start'
      /.rvm/gems/ruby-2.0.0-p353@my_project/gems/railties-4.1.0/lib/rails/commands/commands_tasks.rb:81:in `block in server'
      /.rvm/gems/ruby-2.0.0-p353@my_project/gems/railties-4.1.0/lib/rails/commands/commands_tasks.rb:76:in `tap'
      /.rvm/gems/ruby-2.0.0-p353@my_project/gems/railties-4.1.0/lib/rails/commands/commands_tasks.rb:76:in `server'
      /.rvm/gems/ruby-2.0.0-p353@my_project/gems/railties-4.1.0/lib/rails/commands/commands_tasks.rb:40:in `run_command!'
      /.rvm/gems/ruby-2.0.0-p353@my_project/gems/railties-4.1.0/lib/rails/commands.rb:17:in `&lt;top (required)&gt;'
      bin/rails:4:in `require'
      bin/rails:4:in `&lt;main&gt;'
  
  Unexpected error while processing request: (&lt;unknown&gt;): found character that cannot start any token while scanning for the next token at line 14 column 1
      /.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/psych.rb:205:in `parse'
      /.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/psych.rb:205:in `parse_stream'
      /.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/psych.rb:153:in `parse'
      /.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/psych.rb:129:in `load'
      /.rvm/gems/ruby-2.0.0-p353@my_project/gems/safe_yaml-1.0.3/lib/safe_yaml.rb:15:in `load_with_options'
      /.rvm/gems/ruby-2.0.0-p353@my_project/gems/railties-4.1.0/lib/rails/application.rb:313:in `secrets'
      /.rvm/gems/ruby-2.0.0-p353@my_project/gems/railties-4.1.0/lib/rails/application.rb:439:in `validate_secret_key_config!'
      /.rvm/gems/ruby-2.0.0-p353@my_project/gems/railties-4.1.0/lib/rails/application.rb:195:in `env_config'
      /.rvm/gems/ruby-2.0.0-p353@my_project/gems/railties-4.1.0/lib/rails/engine.rb:510:in `call'
      /.rvm/gems/ruby-2.0.0-p353@my_project/gems/railties-4.1.0/lib/rails/application.rb:144:in `call'
      /.rvm/gems/ruby-2.0.0-p353@global/gems/rack-1.5.2/lib/rack/content_length.rb:14:in `call'
      /.rvm/gems/ruby-2.0.0-p353@my_project/gems/thin-1.6.2/lib/thin/connection.rb:86:in `block in pre_process'
      /.rvm/gems/ruby-2.0.0-p353@my_project/gems/thin-1.6.2/lib/thin/connection.rb:84:in `catch'
      /.rvm/gems/ruby-2.0.0-p353@my_project/gems/thin-1.6.2/lib/thin/connection.rb:84:in `pre_process'
      /.rvm/gems/ruby-2.0.0-p353@my_project/gems/thin-1.6.2/lib/thin/connection.rb:53:in `process'
      /.rvm/gems/ruby-2.0.0-p353@my_project/gems/thin-1.6.2/lib/thin/connection.rb:39:in `receive_data'
      /.rvm/gems/ruby-2.0.0-p353@my_project/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in `run_machine'
      /.rvm/gems/ruby-2.0.0-p353@my_project/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in `run'
      /.rvm/gems/ruby-2.0.0-p353@my_project/gems/thin-1.6.2/lib/thin/backends/base.rb:73:in `start'
      /.rvm/gems/ruby-2.0.0-p353@my_project/gems/thin-1.6.2/lib/thin/server.rb:162:in `start'
      /.rvm/gems/ruby-2.0.0-p353@global/gems/rack-1.5.2/lib/rack/handler/thin.rb:16:in `run'
      /.rvm/gems/ruby-2.0.0-p353@global/gems/rack-1.5.2/lib/rack/server.rb:264:in `start'
      /.rvm/gems/ruby-2.0.0-p353@my_project/gems/railties-4.1.0/lib/rails/commands/server.rb:69:in `start'
      /.rvm/gems/ruby-2.0.0-p353@my_project/gems/railties-4.1.0/lib/rails/commands/commands_tasks.rb:81:in `block in server'
      /.rvm/gems/ruby-2.0.0-p353@my_project/gems/railties-4.1.0/lib/rails/commands/commands_tasks.rb:76:in `tap'
      /.rvm/gems/ruby-2.0.0-p353@my_project/gems/railties-4.1.0/lib/rails/commands/commands_tasks.rb:76:in `server'
      /.rvm/gems/ruby-2.0.0-p353@my_project/gems/railties-4.1.0/lib/rails/commands/commands_tasks.rb:40:in `run_command!'
      /.rvm/gems/ruby-2.0.0-p353@my_project/gems/railties-4.1.0/lib/rails/commands.rb:17:in `&lt;top (required)&gt;'
      bin/rails:4:in `require'
      bin/rails:4:in `&lt;main&gt;'
  </code></pre>
  
  <p>Any thoughts on what could be causing this? </p>
  
  <p>I tried multiple iterations of the secrets.yml file, to even enclose the <code>secret_key_base</code> in single quotations like <code>'somelongasskeyhere'</code> but that didn't work.</p>
  
  <p><strong>Update 1</strong></p>
  
  <p>So it seems the issue may be with how finnicky YAML is. I think it has something to do with the spacing &amp; tabs I put in, but I just can't seem to get it perfect. Now I am getting another error at a different position in the line.</p>
  
  <p>After re-doing some of the spaces to just use the spacebar 4 times, versus the tab - which was set at 4 spaces, I am now getting a different error:</p>
  
  <pre><code>Unexpected error while processing request: (&lt;unknown&gt;): found a tab character that violate intendation while scanning a plain scalar at line 13 column 3
  </code></pre>
  
  <p>Which references this line:</p>
  
  <pre><code>development:
    secret_key_base:'86bc42f97803818b48ff88ef15d9d4df6b6b4e4e723c119967a29751de33b5687af3a57542b4a8364cb3d6b51a872ad1188b9de6f0faab578272451aa798956c'
  </code></pre>
  
  <p><strong>Update 2</strong></p>
  
  <p>It definitely is something to do with my spacing, because once I copied and pasted this file - <a href="https://github.com/RailsApps/rails-devise/blob/master/config/secrets.yml" rel="nofollow">https://github.com/RailsApps/rails-devise/blob/master/config/secrets.yml</a> - into mine and just replaced the key_base with mine, everything worked just fine.</p>