Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Failing to run pod install: "mapping values are not allowed in this context" #1853

Closed
codinglabs opened this Issue · 20 comments
@codinglabs

I just updated cocoapods to 0.29 (also tested with 0.28) from a super old version (can't remember which one) and now I run into the following error message when I execute 'pod install'.

Stack

   CocoaPods : 0.28.0
        Ruby : ruby 2.0.0p247 (2013-06-27 revision 41674) [universal.x86_64-darwin13]
    RubyGems : 2.0.3
        Host : Mac OS X 10.9.2 (13C64)
       Xcode : 5.0.2 (5A3005)
Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib
Repositories : master - https://github.com/CocoaPods/Specs.git @ 9a61a13fc6b5d3b9ecde5ea5b6c1da3a63d1c1d2

Podfile

platform :ios, '7.0'
pod 'MarqueeLabel', '~> 1.2'
pod 'AFNetworking', '~> 2.0'
pod 'FormatterKit', '~> 1.4'

Error

Psych::SyntaxError - (/Users/psteinacher/.cocoapods/repos/master/CocoaPods-version.yml): 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/psych.rb:299:in `block in load_file'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/psych.rb:299:in `open'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/psych.rb:299:in `load_file'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.28.0/lib/cocoapods/sources_manager.rb:248:in `version_information'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.28.0/lib/cocoapods/sources_manager.rb:209:in `repo_compatible?'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.28.0/lib/cocoapods/sources_manager.rb:268:in `master_repo_functional?'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.28.0/lib/cocoapods/command.rb:40:in `parse'
/Library/Ruby/Gems/2.0.0/gems/claide-0.4.0/lib/claide/command.rb:179:in `parse'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.28.0/lib/cocoapods/command.rb:39:in `parse'
/Library/Ruby/Gems/2.0.0/gems/claide-0.4.0/lib/claide/command.rb:211:in `run'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.28.0/lib/cocoapods/command.rb:52:in `run'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.28.0/bin/pod:24:in `<top (required)>'
/usr/bin/pod:23:in `load'
/usr/bin/pod:23:in `<main>'
@alloy
Owner

Hmm, that’s weird. It works for me on 0.29:

~/t/Test1677 » cat ~/.cocoapods/repos/master/CocoaPods-version.yml 
---
min: 0.29.0
last: 0.29.0

~/t/Test1677 » ruby -v
ruby 2.0.0p247 (2013-06-27 revision 41674) [universal.x86_64-darwin13]

~/t/Test1677 » pod install
Analyzing dependencies
Downloading dependencies
Using SVPullToRefresh (0.4.1)
Generating Pods project
Integrating client project

Does your CocoaPods-version.yml file look the same?

@akurkin

0.29 doesn't work for me - same reason as in this issue.

@alloy
Owner

@thaold What does your ~/.cocoapods/repos/master/CocoaPods-version.yml file look like?

@cepages

I had the same problem with a private cocoaPod, I updated to 0.29 and I continued with the same problem.

Maybe it's very destructive but for me it was solved with:

$ sudo rm -fr ~/.cocoapods/repos/master
$ pod setup

I hope this helps

@codinglabs

Ok the problem for me was that (presumably) the update tried to merge CocoaPods-version.yml so in the end it looked like this.

---
<<<<<<< HEAD
min: 0.18.1
=======
min: 0.29.0
>>>>>>> 8365d0ad18508175bbde31b9dd2bdaf1be49214f
last: 0.29.0

@carlosIncuna's solution resolved the issue for me. Thanks!

@alloy
Owner

Aha! That’s unfortunate, but not something that we can fix. I’ll send out a tweet from the main account about this, though. Thanks for the feedback!

@alloy alloy closed this
@linglong117

Thanks :
it was solved with:

$ sudo rm -fr ~/.cocoapods/repos/master
$ pod setup

@soule

Thanks,

linglong's response worked for me.

@medampudi

thanks: @carlosIncuna that worked..

@zachstegall

Thanks @linglong117 ! Worked over here too.

@harryworld

That fixed for me @carlosIncuna

   CocoaPods : 0.30.0
        Ruby : ruby 2.1.1p76 (2014-02-24 revision 45161) [x86_64-darwin12.0]
    RubyGems : 2.2.2
        Host : Mac OS X 10.8.5 (12F45)
       Xcode : 5.1 (5B130a)
Ruby lib dir : /Users/harryng/.rbenv/versions/2.1.1/lib
Repositories : master - https://github.com/CocoaPods/Specs.git @ 7eb87565310805b3a491abf8121be1cffd666068
@kayzee

Took a while to find this issue, but thanks @carlosIncuna, your suggestion worked wonders.

@alloy maybe this should be documented better somewhere. Maybe: http://guides.cocoapods.org/using/troubleshooting.html

@zachwill

Just ran into this, as well. Thanks for the tip, @carlosIncuna!

@zackcalex

Thanks @carlosIncuna , that worked for me!

@Algashev

Many Thanks @carlosIncuna , that worked for me too!

@cepages

@alloy I agree with @kayzee, it seems this happens a lot of people, maybe it's interesting to document this somewhere. yw all! ;)

@alloy
Owner

@carlosIncuna @kayzee This has been merged and will be available in the next release: CocoaPods/Core#100.

@cepages

@alloy That's great!, thanks

@nicroto nicroto referenced this issue in konstantinpavlikhin/Watchdog
Closed

Couldn't build tests... #1

@colinhumber colinhumber referenced this issue in colinhumber/SickBeard-iOS
Closed

Cannot compile #9

@zlc000190

i run

pod install
then error comes

CocoaPods : 0.34.1
Ruby : ruby 2.0.0p481 (2014-05-08 revision 45883) [universal.x86_64-darwin13]
RubyGems : 2.0.14
Host : Mac OS X 10.9.5 ()
Xcode : 6.1 (6A1052d)
Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib
Repositories : master - https://github.com/CocoaPods/Specs.git @ 78dec2644e47aa272fb8c5ddf27a2e23e99c0a50

Plugins

cocoapods-plugins : 0.3.1
cocoapods-trunk   : 0.2.0
cocoapods-try     : 0.4.1

Podfile

platform:ios,
pod 'MJRefresh',
pod 'MBProgressHUD',
pod 'FPPopover',
pod 'BWStatusBarOverlay',
pod 'Zbar',
pod 'ASIHTTPRequest',
pod 'SDWebImage',

## Error

SyntaxError - /Users/soufunlc/Desktop/newzxb/homezxb/Podfile:2: syntax error, unexpected tSTRING_BEG, expecting keyword_do or '{' or '('
pod 'MJRefresh',
^
/Users/soufunlc/Desktop/newzxb/homezxb/Podfile:2: syntax error, unexpected ',', expecting end-of-input
/Library/Ruby/Gems/2.0.0/gems/cocoapods-core-0.34.1/lib/cocoapods-core/podfile.rb:247:in eval'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-core-0.34.1/lib/cocoapods-core/podfile.rb:247:in
block in from_ruby'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-core-0.34.1/lib/cocoapods-core/podfile.rb:51:in instance_eval'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-core-0.34.1/lib/cocoapods-core/podfile.rb:51:in
initialize'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-core-0.34.1/lib/cocoapods-core/podfile.rb:244:in new'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-core-0.34.1/lib/cocoapods-core/podfile.rb:244:in
from_ruby'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-core-0.34.1/lib/cocoapods-core/podfile.rb:220:in from_file'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.34.1/lib/cocoapods/config.rb:176:in
podfile'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.34.1/lib/cocoapods/command.rb:101:in verify_podfile_exists!'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.34.1/lib/cocoapods/command/project.rb:100:in
run'
/Library/Ruby/Gems/2.0.0/gems/claide-0.7.0/lib/claide/command.rb:271:in run'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.34.1/lib/cocoapods/command.rb:48:in
run'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.34.1/bin/pod:33:in <top (required)>'
/usr/bin/pod:23:in
load'
/usr/bin/pod:23:in `'


i try linglong's method ,but doesn't work.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.