Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Psych::SyntaxError: (<unknown>): mapping values are not allowed in this context at line 3 column 4 #4042

Closed
bao1018 opened this issue Oct 7, 2015 · 2 comments

Comments

@bao1018
Copy link

bao1018 commented Oct 7, 2015

I got below error message when I run bundle install
appledev093$ bundle install
Warning: this Gemfile contains multiple primary sources. Using source more than once without a block is a security risk, and may result in installing unexpected gems. To resolve this warning, use a block to indicate which gems should come from the secondary source. To upgrade this warning to an error, run bundle config disable_multisource true.
Fetching gem metadata from https://rails-assets.org/../Library/Ruby/Gems/2.0.0/gems/bundler-1.10.6/lib/bundler.rb:315: warning: Insecure world writable dir /usr/local/bin in PATH, mode 040777
--- ERROR REPORT TEMPLATE -------------------------------------------------------

  • What did you do?

    I ran the command /usr/bin/bundle install

  • What did you expect to happen?

    I expected Bundler to...

  • What happened instead?

    Instead, what actually happened was...

Error details

Psych::SyntaxError: (<unknown>): mapping values are not allowed in this context at line 3 column 4
  /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/psych.rb:205:in `parse'
  /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/psych.rb:205:in `parse_stream'
  /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/psych.rb:153:in `parse'
  /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/psych.rb:129:in `load'
  /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/config_file.rb:319:in `load_file'
  /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/config_file.rb:192:in `initialize'
  /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems.rb:324:in `new'
  /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems.rb:324:in `configuration'
  /Library/Ruby/Gems/2.0.0/gems/bundler-1.10.6/lib/bundler/rubygems_integration.rb:65:in `configuration'
  /Library/Ruby/Gems/2.0.0/gems/bundler-1.10.6/lib/bundler/rubygems_integration.rb:88:in `sources='
  /Library/Ruby/Gems/2.0.0/gems/bundler-1.10.6/lib/bundler/fetcher.rb:126:in `specs'
  /Library/Ruby/Gems/2.0.0/gems/bundler-1.10.6/lib/bundler/source/rubygems.rb:343:in `block (2 levels) in remote_specs'
  /Library/Ruby/Gems/2.0.0/gems/bundler-1.10.6/lib/bundler/source/rubygems.rb:341:in `each'
  /Library/Ruby/Gems/2.0.0/gems/bundler-1.10.6/lib/bundler/source/rubygems.rb:341:in `block in remote_specs'
  /Library/Ruby/Gems/2.0.0/gems/bundler-1.10.6/lib/bundler/index.rb:9:in `build'
  /Library/Ruby/Gems/2.0.0/gems/bundler-1.10.6/lib/bundler/source/rubygems.rb:324:in `remote_specs'
  /Library/Ruby/Gems/2.0.0/gems/bundler-1.10.6/lib/bundler/source/rubygems.rb:81:in `specs'
  /Library/Ruby/Gems/2.0.0/gems/bundler-1.10.6/lib/bundler/lazy_specification.rb:53:in `__materialize__'
  /Library/Ruby/Gems/2.0.0/gems/bundler-1.10.6/lib/bundler/spec_set.rb:88:in `block in materialize'
  /Library/Ruby/Gems/2.0.0/gems/bundler-1.10.6/lib/bundler/spec_set.rb:85:in `map!'
  /Library/Ruby/Gems/2.0.0/gems/bundler-1.10.6/lib/bundler/spec_set.rb:85:in `materialize'
  /Library/Ruby/Gems/2.0.0/gems/bundler-1.10.6/lib/bundler/definition.rb:140:in `specs'
  /Library/Ruby/Gems/2.0.0/gems/bundler-1.10.6/lib/bundler/definition.rb:129:in `resolve_remotely!'
  /Library/Ruby/Gems/2.0.0/gems/bundler-1.10.6/lib/bundler/installer.rb:79:in `run'
  /Library/Ruby/Gems/2.0.0/gems/bundler-1.10.6/lib/bundler/installer.rb:18:in `install'
  /Library/Ruby/Gems/2.0.0/gems/bundler-1.10.6/lib/bundler/cli/install.rb:107:in `run'
  /Library/Ruby/Gems/2.0.0/gems/bundler-1.10.6/lib/bundler/cli.rb:162:in `install'
  /Library/Ruby/Gems/2.0.0/gems/bundler-1.10.6/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
  /Library/Ruby/Gems/2.0.0/gems/bundler-1.10.6/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
  /Library/Ruby/Gems/2.0.0/gems/bundler-1.10.6/lib/bundler/vendor/thor/lib/thor.rb:359:in `dispatch'
  /Library/Ruby/Gems/2.0.0/gems/bundler-1.10.6/lib/bundler/vendor/thor/lib/thor/base.rb:440:in `start'
  /Library/Ruby/Gems/2.0.0/gems/bundler-1.10.6/lib/bundler/cli.rb:10:in `start'
  /Library/Ruby/Gems/2.0.0/gems/bundler-1.10.6/bin/bundle:20:in `block in <top (required)>'
  /Library/Ruby/Gems/2.0.0/gems/bundler-1.10.6/lib/bundler/friendly_errors.rb:7:in `with_friendly_errors'
  /Library/Ruby/Gems/2.0.0/gems/bundler-1.10.6/bin/bundle:18:in `<top (required)>'
  /usr/bin/bundle:23:in `load'
  /usr/bin/bundle:23:in `<main>'

Environment

Bundler   1.10.6
Rubygems  2.0.14
Ruby      2.0.0p481 (2014-05-08 revision 45883) [universal.x86_64-darwin14]
GEM_HOME  /Users/appledev093/Projects/Labs/gitbase/Game-of-Threats/vendor/ruby/2.0.0
GEM_PATH
Git       2.5.2

Bundler settings

path
  Set for your local app (/Users/appledev093/Projects/Labs/gitbase/Game-of-Threats/.bundle/config): "vendor"
disable_shared_gems
  Set for your local app (/Users/appledev093/Projects/Labs/gitbase/Game-of-Threats/.bundle/config): "1"

--- TEMPLATE END ----------------------------------------------------------------

Unfortunately, an unexpected error occurred, and Bundler cannot continue.

First, try this link to see if there are any existing issue reports for this error:
https://github.com/bundler/bundler/search?q=%28%3Cunknown%3E%29%3A+mapping+values+are+not+allowed+in+this+context+at+line+3+column+4&type=Issues

If there aren't any reports for this error yet, please create copy and paste the report template above into a new issue. Don't forget to anonymize any private data! The new issue form is located at:
https://github.com/bundler/bundler/issues/new

@segiddins
Copy link
Member

It looks like your ruby gems config file is invalid.

@agis agis closed this as completed Oct 21, 2015
@indirect indirect reopened this Oct 25, 2015
@indirect
Copy link
Member

End users should never see backtraces; let's print an error with what information we have (and if needed say that they can check the validity of a YAML file at url X or with command Y)

agis added a commit that referenced this issue Oct 27, 2015
agis added a commit that referenced this issue Oct 27, 2015
agis added a commit that referenced this issue Oct 27, 2015
agis added a commit that referenced this issue Oct 27, 2015
agis added a commit that referenced this issue Oct 27, 2015
agis added a commit that referenced this issue Oct 28, 2015
agis added a commit that referenced this issue Oct 28, 2015
homu added a commit that referenced this issue Oct 28, 2015
Handle invalid RubyGems config files

Fixes #4042.
homu added a commit that referenced this issue Oct 28, 2015
Handle invalid RubyGems config files

Fixes #4042.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants