Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
codinglabs opened this issue Mar 3, 2014 · 21 comments
Closed

Comments

@codinglabs
Copy link

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
Copy link
Member

alloy commented Mar 3, 2014

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
Copy link

akurkin commented Mar 4, 2014

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

@alloy
Copy link
Member

alloy commented Mar 4, 2014

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

@cepages
Copy link

cepages commented Mar 4, 2014

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
Copy link
Author

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
Copy link
Member

alloy commented Mar 4, 2014

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!

@linglong117
Copy link

Thanks :
it was solved with:

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

@soule
Copy link

soule commented Mar 16, 2014

Thanks,

linglong's response worked for me.

@medampudi
Copy link

thanks: @carlosIncuna that worked..

@zachstegall
Copy link

Thanks @linglong117 ! Worked over here too.

@harryworld
Copy link

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
Copy link

kayzee commented Apr 1, 2014

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
Copy link

zachwill commented Apr 5, 2014

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

@zackcalex
Copy link

Thanks @carlosIncuna , that worked for me!

@Algashev
Copy link

Algashev commented Apr 8, 2014

Many Thanks @carlosIncuna , that worked for me too!

@cepages
Copy link

cepages commented Apr 9, 2014

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

@alloy
Copy link
Member

alloy commented Apr 9, 2014

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

@cepages
Copy link

cepages commented Apr 9, 2014

@alloy That's great!, thanks

@matryer
Copy link

matryer commented May 26, 2014

👍

@zlc000190
Copy link

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:inblock 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:ininitialize'
/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:infrom_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:inpodfile'
/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:inrun'
/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:inrun'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.34.1/bin/pod:33:in <top (required)>' /usr/bin/pod:23:inload'
/usr/bin/pod:23:in `

'


i try linglong's method ,but doesn't work.

@ymoyao
Copy link

ymoyao commented May 3, 2016

@zlc000190 the same question with you,do you solve it ? if you did,i demand you emil me developer_yh@163,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests