title: bundle install results in "mapping values are not allowed in this context" error
body: <p>I have a rails 4 project that has been working for some time. I attempted to install  <code>taps</code> but got an error message:</p>
  
  <pre><code>$ gem install taps
  
  /usr/local/rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/psych.rb:370:in `parse': (&lt;unknown&gt;): mapping values are not allowed in this context at line 2 column 29 (Psych::SyntaxError)
      from /usr/local/rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/psych.rb:370:in `parse_stream'
      from /usr/local/rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/psych.rb:318:in `parse'
      from /usr/local/rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/psych.rb:245:in `load'
      from /usr/local/rvm/rubies/ruby-2.2.1/lib/ruby/site_ruby/2.2.0/rubygems/config_file.rb:333:in `load_file'
      from /usr/local/rvm/rubies/ruby-2.2.1/lib/ruby/site_ruby/2.2.0/rubygems/config_file.rb:198:in `initialize'
      from /usr/local/rvm/rubies/ruby-2.2.1/lib/ruby/site_ruby/2.2.0/rubygems/gem_runner.rb:74:in `new'
      from /usr/local/rvm/rubies/ruby-2.2.1/lib/ruby/site_ruby/2.2.0/rubygems/gem_runner.rb:74:in `do_configuration'
      from /usr/local/rvm/rubies/ruby-2.2.1/lib/ruby/site_ruby/2.2.0/rubygems/gem_runner.rb:39:in `run'
      from /usr/local/rvm/rubies/ruby-2.2.1/bin/gem:21:in `&lt;main&gt;'
  </code></pre>
  
  <p>I get the same error message when trying to run <code>gem list</code> or <code>bundle update</code>. I <a href="https://stackoverflow.com/questions/18685702/rails-4-mapping-values-are-not-allowed-in-this-context-at-line-2-column-11-psy">searched for similar problems</a>, and it seems the cause is typically an improperly formatted YAML file. My <code>database.yml</code> file and <code>Gemfile</code> were not recently updated, so I don't know when this bug was introduced.</p>
  
  <p>I found a <a href="https://github.com/rails/rails/issues/8143" rel="nofollow noreferrer">rails issue on Github</a> that describes this error, and someone recommended parsing YAML files with <code>irb</code> to isolate the issue. I tried parsing <code>database.yml</code> and <code>Gemfile</code>:</p>
  
  <p><strong>config/database.yml</strong></p>
  
  <pre><code># SQLite version 3.x
  #   gem install sqlite3
  #
  #   Ensure the SQLite 3 gem is defined in your Gemfile
  #   gem 'sqlite3'
  #
  default: &amp;default
    adapter: sqlite3
    pool: 5
    timeout: 5000
  
  development:
    &lt;&lt;: *default
    database: db/development.sqlite3
  
  # Warning: The database defined as "test" will be erased and
  # re-generated from your development database when you run "rake".
  # Do not set this db to the same as development or production.
  test:
    &lt;&lt;: *default
    database: db/test.sqlite3
  
  production:
    &lt;&lt;: *default
    database: db/production.sqlite3
  </code></pre>
  
      
  
  <pre><code>$ irb -ryaml
  2.2.1 :001 &gt; YAML.load_file 'config/database.yml'
   =&gt; {"default"=&gt;{"adapter"=&gt;"sqlite3", "pool"=&gt;5, "timeout"=&gt;5000}, "development"=&gt;{"adapter"=&gt;"sqlite3", "pool"=&gt;5, "timeout"=&gt;5000, "database"=&gt;"db/development.sqlite3"}, "test"=&gt;{"adapter"=&gt;"sqlite3", "pool"=&gt;5, "timeout"=&gt;5000, "database"=&gt;"db/test.sqlite3"}, "production"=&gt;{"adapter"=&gt;"sqlite3", "pool"=&gt;5, "timeout"=&gt;5000, "database"=&gt;"db/production.sqlite3"}} 
  </code></pre>
  
  <p><strong>Gemfile</strong></p>
  
  <pre><code>source 'https://rubygems.org'
  
  gem 'rails',                   '4.2.2'
  gem 'faker',                   '1.4.2'
  gem 'will_paginate',           '3.0.7'
  gem 'bootstrap-will_paginate', '0.0.10'
  gem 'bootstrap-sass',          '3.2.0.0'
  gem 'sass-rails',              '5.0.2'
  gem 'uglifier',                '2.5.3'
  gem 'coffee-rails',            '4.1.0'
  gem 'jquery-rails',            '4.0.3'
  gem 'turbolinks',              '2.3.0'
  gem 'jbuilder',                '2.2.3'
  gem 'devise',                  '3.5.6'
  
  group :development, :test do
    gem 'sqlite3',     '1.3.9'
    gem 'byebug',      '3.4.0'
    gem 'web-console', '2.0.0.beta3'
    gem 'spring',      '1.1.3'
  end
  
  group :test do
    gem 'minitest-reporters', '1.0.5'
    gem 'mini_backtrace',     '0.1.3'
    gem 'guard-minitest',     '2.3.1'
  end
  
  group :production do
    gem 'pg',             '0.17.1'
    gem 'rails_12factor', '0.0.2'
  end
  </code></pre>
  
  
  
  <pre><code>$ irb -ryaml
  2.2.1 :001 &gt; YAML.load_file 'Gemfile'
   =&gt; "source 'https://rubygems.org'\n\ngem 'rails',                   '4.2.2' gem 'faker',                   '1.4.2' gem 'will_paginate',           '3.0.7' gem 'bootstrap-will_paginate', '0.0.10' gem 'bootstrap-sass',          '3.2.0.0' gem 'sass-rails',              '5.0.2' gem 'uglifier',                '2.5.3' gem 'coffee-rails',            '4.1.0' gem 'jquery-rails',            '4.0.3' gem 'turbolinks',              '2.3.0' gem 'jbuilder',                '2.2.3' gem 'devise',                  '3.5.6'\ngroup :development, :test do gem 'sqlite3',     '1.3.9' gem 'byebug',      '3.4.0' gem 'web-console', '2.0.0.beta3' gem 'spring',      '1.1.3' end\ngroup :test do gem 'minitest-reporters', '1.0.5' gem 'mini_backtrace',     '0.1.3' gem 'guard-minitest',     '2.3.1' end\ngroup :production do gem 'pg',             '0.17.1' gem 'rails_12factor', '0.0.2' end" 
  </code></pre>
  
  <p>Both files parse correctly, so I am stuck. I don't know why the commands keep failing since the error message doesn't identify the offending file.</p>