(<unknown>): could not find expected ':' while scanning a simple key at line 3 column 1 (Psych::SyntaxError)
I am trying to run a bundle install on a rails project pulled from git. When I run the bundle install I get the following error:
/Users/jordandeutsch/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/psych.rb:370:in `parse': (<unknown>): could not find expected ':' while scanning a simple key at line 3 column 1 (Psych::SyntaxError) from /Users/jordandeutsch/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/psych.rb:370:in `parse_stream' from /Users/jordandeutsch/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/psych.rb:318:in `parse' from /Users/jordandeutsch/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/psych.rb:245:in `load' from /Users/jordandeutsch/.rvm/rubies/ruby-2.2.1/lib/ruby/site_ruby/2.2.0/rubygems/config_file.rb:333:in `load_file' from /Users/jordandeutsch/.rvm/rubies/ruby-2.2.1/lib/ruby/site_ruby/2.2.0/rubygems/config_file.rb:198:in `initialize' from /Users/jordandeutsch/.rvm/rubies/ruby-2.2.1/lib/ruby/site_ruby/2.2.0/rubygems/gem_runner.rb:74:in `new' from /Users/jordandeutsch/.rvm/rubies/ruby-2.2.1/lib/ruby/site_ruby/2.2.0/rubygems/gem_runner.rb:74:in `do_configuration' from /Users/jordandeutsch/.rvm/rubies/ruby-2.2.1/lib/ruby/site_ruby/2.2.0/rubygems/gem_runner.rb:39:in `run' from /Users/jordandeutsch/.rvm/rubies/ruby-2.2.1/bin/gem:21:in `<main>'
This is my Gemfile:
After some digging I thought it might be an issue with rvm as I tried pulling an old project off git and was still unable to run the bundle install. I also tried copying a project locally and running the install and starting a new project all without success.
After reinstalling rvm I ran
rvm use ruby --install --defaultand got the following error (similar to above)
/Users/jordandeutsch/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/psych.rb:370:in `parse': (<unknown>): could not find expected ':' while scanning a simple key at line 3 column 1 (Psych::SyntaxError) from /Users/jordandeutsch/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/psych.rb:370:in `parse_stream' from /Users/jordandeutsch/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/psych.rb:318:in `parse' from /Users/jordandeutsch/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/psych.rb:245:in `load' from /Users/jordandeutsch/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/rubygems/config_file.rb:333:in `load_file' from /Users/jordandeutsch/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/rubygems/config_file.rb:198:in `initialize' from /Users/jordandeutsch/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/rubygems/gem_runner.rb:74:in `new' from /Users/jordandeutsch/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/rubygems/gem_runner.rb:74:in `do_configuration' from /Users/jordandeutsch/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/rubygems/gem_runner.rb:39:in `run' from /Users/jordandeutsch/.rvm/rubies/ruby-2.2.3/bin/gem:25:in `<main>'
Essentially I cannot begin a new rails project on the computer. Any insight would be appreciated.
2 Solutions collect form web for “(<unknown>): could not find expected ':' while scanning a simple key at line 3 column 1 (Psych::SyntaxError)”
This error usually comes out if you have syntax errors in the .yml files.
Have a look if you can find any mistake in there.
You can also try and remove the .gemrc file from the home directory. It could be that the error is in there.
I had this issue recently had this issue. My issue:
default: &default FOO_KEY: 'XXXXX' development: <<: *default test: <<: *default
default: &default FOO_KEY: 'asdf' BAR_KEY: 'XXXXXXXXXXX' FOO_BAR: 'XXXXXXXXXXXX' development: <<: *default test: <<: *default
Did not work. What I tried:
- Rewrite application.yml
- Remove GEMFILE.lock and reinstall all gems
- change the values and names of keys
- check all configs for typos
None of these helped fix the issue. So as any good engineer I burned it to the ground. I cloned my project into a new directory and rewrote the application.yml and that worked. Both repos are on the same branch and on the same changeset.