title: Rails + YAML : Parsing error when loading YAML data from application.yml
body: <p>To seed my database with airport names, I use <em>application.yml</em> to define a collection of airports:</p>
  
  <pre><code>AIRPORTS:
    - name: "Charles de Gaulle"
      city: "Paris"
      country: "France"
    - name: "Orly"
      city: "Paris"
      country: "France"
  </code></pre>
  
  <p>Using Rails Command (rails c) to test, I have:</p>
  
  <pre><code>2.0.0-p247 :001 &gt; ENV['AIRPORTS']
   =&gt; "[{\"name\"=&gt;\"Charles de Gaulle\", \"city\"=&gt;\"Paris\", \"country\"=&gt;\"France\"}, {\"name\"=&gt;\"Orly\", \"city\"=&gt;\"Paris\", \"country\"=&gt;\"France\"}]"
  </code></pre>
  
  <p>which is a string! Then, when typing the following, I have an error:</p>
  
  <pre><code>2.0.0-p247 :002 &gt; YAML.load(ENV['AIRPORTS'])
  Psych::SyntaxError: (&lt;unknown&gt;): did not find expected ',' or '}' while parsing a flow mapping at line 1 column 2
  from /Users/Hassen/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/psych.rb:205:in `parse'
  from /Users/Hassen/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/psych.rb:205:in `parse_stream'
  from /Users/Hassen/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/psych.rb:153:in `parse'
  from /Users/Hassen/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/psych.rb:129:in `load'
  from (irb):2
  from /Users/Hassen/.rvm/gems/ruby-2.0.0-p247/gems/railties-3.2.13/lib/rails/commands/console.rb:47:in `start'
  from /Users/Hassen/.rvm/gems/ruby-2.0.0-p247/gems/railties-3.2.13/lib/rails/commands/console.rb:8:in `start'
  from /Users/Hassen/.rvm/gems/ruby-2.0.0-p247/gems/railties-3.2.13/lib/rails/commands.rb:41:in `&lt;top (required)&gt;'
  from script/rails:6:in `require'
  from script/rails:6:in `&lt;main&gt;'
  </code></pre>
  
  <p>What I'm expecting (what I want) is to have an array of objects, so I can seed my database with the following code:</p>
  
  <pre><code>YAML.load(ENV['AIRPORTS']).each do |airport|
      AirPort.create airport
      puts 'airport created: ' &lt;&lt; airport.name
  end
  </code></pre>
  
  <p>Thanks,</p>