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

Pod setup error. #2908

Closed
geoffharcourt opened this Issue Dec 4, 2014 · 64 comments

Comments

Projects
None yet
@geoffharcourt
Copy link

geoffharcourt commented Dec 4, 2014

I am trying to install a Cocoapods fresh on my OSX Yosemite machine. I'm using Ruby 2.1.5 and zsh. Here are my order of steps:

  1. Make sure there's no residual Cocoapods config on my machine with rm -rf ~/.cocoapods
  2. Uninstall all Cocoapods-related gems (downloader, trunk, try, plugins, etc)
  3. Install Cocoapods 0.35.0 and run pod setup
[ ~ ] ✔ gem install cocoapods
Fetching: cocoapods-trunk-0.4.1.gem (100%)
Successfully installed cocoapods-trunk-0.4.1
Fetching: cocoapods-try-0.4.2.gem (100%)
Successfully installed cocoapods-try-0.4.2
Fetching: cocoapods-plugins-0.3.2.gem (100%)
Successfully installed cocoapods-plugins-0.3.2
Fetching: cocoapods-downloader-0.8.0.gem (100%)
Successfully installed cocoapods-downloader-0.8.0
Fetching: cocoapods-core-0.35.0.gem (100%)
Successfully installed cocoapods-core-0.35.0
Fetching: cocoapods-0.35.0.gem (100%)
Successfully installed cocoapods-0.35.0
6 gems installed
[ ~ ] ✔ pod setup
Setting up CocoaPods master repo
[!] There was an error reading '/Users/geoff/.cocoapods/repos/master/CocoaPods-version.yml'.
Please consult http://blog.cocoapods.org/Repairing-Our-Broken-Specs-Repository/ for more information.

My YAML file referenced in the error looks like this:

---
min: 0.32.1
last: 0.35.0

I can get all of this to work if I uninstall everything and then install and lock my version of Cocoapods to 0.32.1 (and I can use Cocoapods in my project), but if I update to 0.35.0, I can neither successfully run pod setup nor execute pod install on my project with 0.35.0.

@geoffharcourt

This comment has been minimized.

Copy link

geoffharcourt commented Dec 4, 2014

One further update: @Keithbsmiley mentioned in a forum that it might be a file encoding issue, but after checking my Podfile.lock and Manifest.lock and my CocoaPods-version.yml files in an editor, they have utf-8 encoding.

If I downgrade to Ruby 2.0.0 I am able to setup and install successfully, so I think there is something leaking in from another gem I have installed that was causing the problem. I'm not sure how to go about diagnosing the issue, but I'm happy to provide any further info that could be useful.

@segiddins

This comment has been minimized.

Copy link
Member

segiddins commented Dec 4, 2014

What's the output of env | grep LANG?

@geoffharcourt

This comment has been minimized.

Copy link

geoffharcourt commented Dec 4, 2014

LANG=en_US.UTF-8

I deleted every installed gem and started over and things worked. My suspicion is that there's some external dependency that's causing the problem. Here were the gems I had installed at the time of the problem, I took a snapshot before I scorched the earth: https://gist.github.com/geoffharcourt/e0a7dff823b8087baf45

@segiddins

This comment has been minimized.

Copy link
Member

segiddins commented Dec 4, 2014

That is very strange indeed...

@konomae

This comment has been minimized.

Copy link

konomae commented Dec 9, 2014

In my case, I solved the problem by reinstalling Ruby.

# vim ~/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/cocoapods-core-0.35.0/lib/cocoapods-core/yaml_helper.rb
def load_string(yaml_string, file_path = nil)
  YAML.load(yaml_string)
  rescue Exception => e
    p e
    if yaml_has_merge_error?(yaml_string)
      raise Informative, yaml_merge_conflict_msg(yaml_string, file_path)
    else
      raise Informative, yaml_parsing_error_msg(yaml_string, file_path)
    end
end
#<NoMethodError: private method `load' called for Psych:Module>
@dmi3j

This comment has been minimized.

Copy link

dmi3j commented Dec 9, 2014

Same problem.

mac:~ jenkins$ pod setup --verbose

Setting up CocoaPods master repo

Creating shallow clone of spec repo `master` from `https://github.com/CocoaPods/Specs.git` (branch `master`)
  $ /usr/bin/git clone 'https://github.com/CocoaPods/Specs.git' master --depth=1
  Cloning into 'master'...
Checking out files: 100% (25838/25838), done.
  $ /usr/bin/git checkout master
  Already on 'master'
  Your branch is up-to-date with 'origin/master'.
[!] There was an error reading '/Users/jenkins/.cocoapods/repos/master/CocoaPods-version.yml'.
Please consult http://blog.cocoapods.org/Repairing-Our-Broken-Specs-Repository/ for more information.

/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.35.0/lib/cocoapods/sources_manager.rb:316:in `rescue in version_information'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.35.0/lib/cocoapods/sources_manager.rb:313:in `version_information'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.35.0/lib/cocoapods/sources_manager.rb:234:in `check_version_information'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.35.0/lib/cocoapods/command/repo.rb:57:in `block in run'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.35.0/lib/cocoapods/user_interface.rb:49:in `section'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.35.0/lib/cocoapods/command/repo.rb:49:in `run'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.35.0/lib/cocoapods/command/setup.rb:84:in `add_master_repo'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.35.0/lib/cocoapods/command/setup.rb:40:in `block in run'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.35.0/lib/cocoapods/user_interface.rb:49:in `section'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.35.0/lib/cocoapods/command/setup.rb:32: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.35.0/lib/cocoapods/command.rb:45:in `run'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.35.0/bin/pod:43:in `<top (required)>'
/usr/bin/pod:23:in `load'
/usr/bin/pod:23:in `<main>'
@dmi3j

This comment has been minimized.

Copy link

dmi3j commented Dec 9, 2014

I was able to fix the problem.
I was trying to remember what was installed recently and what might cause the problem. I've also noticed @geoffharcourt has sinatra in his list. So, uninstalled two pods

sudo gem uninstall ocunit2junit
sudo gem uninstall sinatra

Then perform cleanup

sudo gem cleanup

uninstalling manually all the problems, including

sudo gem uninstall -i /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/gems/2.0.0 sqlite3
sudo gem uninstall -i /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/gems/2.0.0 nokogiri
sudo gem uninstall -i /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/gems/2.0.0 libxml-ruby
sudo gem uninstall -i /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/gems/2.0.0 sqlite3
sudo gem uninstall -i /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/gems/2.0.0 CFPropertyList
sudo gem uninstall -i /Library/Ruby/Gems/2.0.0 CFPropertyList

After that, clean install of CocoaPods

sudo rm -fr ~/.cocoapods/repos/master
sudo gem uninstall cocoapods
sudo gem update
sudo gem instal cocoapods
pod setup

And problem solved. (dancing)
This is definitely some other gem problem. Hope this might help somebody else.

@csknns

This comment has been minimized.

Copy link

csknns commented Dec 9, 2014

I had the same problem but I traced it to the new version of the gem psych. I uninstalled it and installed the version 2.0.0 and I solved my problem.

sudo gem uninstall psych
sudo gem install psych -v 2.0.0

It seems that the issue is the in the new version the YAML.load function (that is used in cocoapods-core-0.35.0/lib/cocoapods-core/yaml_helper.rb) is private in the new version, so it fails to parse the CocoaPods-version.yml.

@zhentan

This comment has been minimized.

Copy link

zhentan commented Dec 9, 2014

i had the same problem and did the delete every gem and reinstall. That seems to be the for sure fix.

@mmcer

This comment has been minimized.

Copy link

mmcer commented Dec 11, 2014

I also have the same problem, then , i get the solution from @csknns. This issue cause me 3 days , e...

@Gernot

This comment has been minimized.

Copy link

Gernot commented Dec 12, 2014

Same Problem here. Going back to v2.0.0 of the psych gem fixed it for me, too.

@clemensg

This comment has been minimized.

Copy link

clemensg commented Dec 13, 2014

Same here. Reverting psych fixed it.

1 similar comment
@wbcyclist

This comment has been minimized.

Copy link

wbcyclist commented Dec 15, 2014

Same here. Reverting psych fixed it.

@segiddins

This comment has been minimized.

Copy link
Member

segiddins commented Dec 16, 2014

What is the problem version of psych?

@geoffharcourt

This comment has been minimized.

Copy link

geoffharcourt commented Dec 16, 2014

2.0.8 was a problem version for me, 2.0.5 worked.

@segiddins

This comment has been minimized.

Copy link
Member

segiddins commented Dec 16, 2014

@geoffharcourt

This comment has been minimized.

Copy link

geoffharcourt commented Dec 16, 2014

OK, but I just ran it with psych 2.0.8 installed, it failed, then I uninstalled psych 2.0.8 and then it ran successfully with 2.0.5 only on my machine:

[ ~ ] ✔ pod setup
Setting up CocoaPods master repo
First, rewinding head to replay your work on top of it...

Fast-forwarded master to a38c41856f139c193cfcf7d966a91f4f4c2eac56.
From https://github.com/CocoaPods/Specs

   c45ff37..a38c418  master     -> origin/master
[!] There was an error reading '/Users/geoff/.cocoapods/repos/master/CocoaPods-version.yml'.
Please consult http://blog.cocoapods.org/Repairing-Our-Broken-Specs-Repository/ for more information.
[ ~ ] ✔ gem uninstall psych
Successfully uninstalled psych-2.0.8
[ ~ ] ✔ pod setup
Setting up CocoaPods master repo
Current branch master is up to date.
Setup completed
[ ~ ] ✔

It may be that Psych.load isn't the issue (I saw a previous commenter trace to that problem, apologies for throwing you off the trail if I was wrong), but the 2.0.8 version of the gem is definitely having some kind of bad interaction with cocoapods.

@segiddins

This comment has been minimized.

Copy link
Member

segiddins commented Dec 16, 2014

I just installed psych 2.0.8 and pod setup works fine...

@geoffharcourt

This comment has been minimized.

Copy link

geoffharcourt commented Dec 16, 2014

Hrm. I just added psych 2.0.8 back and pod setup immediately failed again.

Here are a couple of other details that might be relevant:

  1. I'm using Ruby 2.1.5
  2. I'm using rbenv
@segiddins

This comment has been minimized.

Copy link
Member

segiddins commented Dec 16, 2014

@geoffharcourt I too am using Ruby 2.1.5 and rbenv. This is indeed very mysterious.

@neonichu

This comment has been minimized.

Copy link
Member

neonichu commented Dec 16, 2014

I was also unable to reproduce it, with either Ruby 2.1.5 or 2.0.0 - even when deliberately destroying the copy of Psych that ships with those Rubies.

Could one of you experiencing the problem add the following to sources_manager.rb, line 316:

puts e.message
puts e.backtrace.join("\n")

that way we can see the actual exception.

We should probably also change those catch-statements so that we can at least see actual exceptions in verbose mode?

@geoffharcourt

This comment has been minimized.

Copy link

geoffharcourt commented Dec 16, 2014

Hi @neonichu, here's my output after adding those debug statements:

[ cocoapods ] ✔ gem install cocoapods-0.35.0.gem
Successfully installed cocoapods-0.35.0
1 gem installed
[ cocoapods ] ✔ pod setup
Setting up CocoaPods master repo
Current branch master is up to date.
[!] ERROR: Parsing unable to continue due to parsing error:
contained in the file located at /Users/geoff/.cocoapods/repos/master/CocoaPods-version.yml
---
min: 0.32.1
last: 0.35.0

/Users/geoff/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/cocoapods-core-0.35.0/lib/cocoapods-core/yaml_helper.rb:60:in `rescue in load_string'
/Users/geoff/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/cocoapods-core-0.35.0/lib/cocoapods-core/yaml_helper.rb:55:in `load_string'
/Users/geoff/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/cocoapods-core-0.35.0/lib/cocoapods-core/yaml_helper.rb:73:in `load_file'
/Users/geoff/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/cocoapods-0.35.0/lib/cocoapods/sources_manager.rb:314:in `version_information'
/Users/geoff/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/cocoapods-0.35.0/lib/cocoapods/sources_manager.rb:234:in `check_version_information'
/Users/geoff/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/cocoapods-0.35.0/lib/cocoapods/sources_manager.rb:205:in `block (2 levels) in update'
/Users/geoff/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/cocoapods-0.35.0/lib/cocoapods/user_interface.rb:49:in `section'
/Users/geoff/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/cocoapods-0.35.0/lib/cocoapods/sources_manager.rb:193:in `block in update'
/Users/geoff/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/cocoapods-0.35.0/lib/cocoapods/sources_manager.rb:192:in `each'
/Users/geoff/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/cocoapods-0.35.0/lib/cocoapods/sources_manager.rb:192:in `update'
/Users/geoff/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/cocoapods-0.35.0/lib/cocoapods/command/setup.rb:92:in `update_master_repo'
/Users/geoff/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/cocoapods-0.35.0/lib/cocoapods/command/setup.rb:36:in `block in run'
/Users/geoff/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/cocoapods-0.35.0/lib/cocoapods/user_interface.rb:49:in `section'
/Users/geoff/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/cocoapods-0.35.0/lib/cocoapods/command/setup.rb:32:in `run'
/Users/geoff/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/claide-0.7.0/lib/claide/command.rb:271:in `run'
/Users/geoff/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/cocoapods-0.35.0/lib/cocoapods/command.rb:45:in `run'
/Users/geoff/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/cocoapods-0.35.0/bin/pod:43:in `<top (required)>'
/Users/geoff/.rbenv/versions/2.1.5/bin/pod:23:in `load'
/Users/geoff/.rbenv/versions/2.1.5/bin/pod:23:in `<main>'
[!] There was an error reading '/Users/geoff/.cocoapods/repos/master/CocoaPods-version.yml'.
Please consult http://blog.cocoapods.org/Repairing-Our-Broken-Specs-Repository/ for more information.
@neonichu

This comment has been minimized.

Copy link
Member

neonichu commented Dec 16, 2014

@geoffharcourt Thanks, unfortunately another catch masking the underlying error.

Could you also add:

puts $!, $@

in line 57 of /Users/geoff/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/cocoapods-core-0.35.0/lib/cocoapods-core/yaml_helper.rb please?

@geoffharcourt

This comment has been minimized.

Copy link

geoffharcourt commented Dec 16, 2014

Here's the new section that's relevant after that change, @neonichu:

private method `load' called for Psych:Module
/Users/geoff/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/cocoapods-core-0.35.0/lib/cocoapods-core/yaml_helper.rb:55:in `load_string'
/Users/geoff/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/cocoapods-core-0.35.0/lib/cocoapods-core/yaml_helper.rb:74:in `load_file'
/Users/geoff/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/cocoapods-0.35.0/lib/cocoapods/sources_manager.rb:314:in `version_information'
/Users/geoff/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/cocoapods-0.35.0/lib/cocoapods/sources_manager.rb:234:in `check_version_information'
/Users/geoff/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/cocoapods-0.35.0/lib/cocoapods/sources_manager.rb:205:in `block (2 levels) in update'
/Users/geoff/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/cocoapods-0.35.0/lib/cocoapods/user_interface.rb:49:in `section'
/Users/geoff/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/cocoapods-0.35.0/lib/cocoapods/sources_manager.rb:193:in `block in update'
/Users/geoff/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/cocoapods-0.35.0/lib/cocoapods/sources_manager.rb:192:in `each'
/Users/geoff/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/cocoapods-0.35.0/lib/cocoapods/sources_manager.rb:192:in `update'
/Users/geoff/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/cocoapods-0.35.0/lib/cocoapods/command/setup.rb:92:in `update_master_repo'
/Users/geoff/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/cocoapods-0.35.0/lib/cocoapods/command/setup.rb:36:in `block in run'
/Users/geoff/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/cocoapods-0.35.0/lib/cocoapods/user_interface.rb:49:in `section'
/Users/geoff/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/cocoapods-0.35.0/lib/cocoapods/command/setup.rb:32:in `run'
/Users/geoff/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/claide-0.7.0/lib/claide/command.rb:271:in `run'
/Users/geoff/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/cocoapods-0.35.0/lib/cocoapods/command.rb:45:in `run'
/Users/geoff/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/cocoapods-0.35.0/bin/pod:43:in `<top (required)>'
/Users/geoff/.rbenv/versions/2.1.5/bin/pod:23:in `load'

This seems to fit with the earlier suggestion by @csknns that there was something with public/private scope that was contributing to the problem.

(BTW, thank you very much for assisting here. I'm new to iOS development, and very much want to be able to use Cocoapods in my workflow.)

@neonichu

This comment has been minimized.

Copy link
Member

neonichu commented Dec 16, 2014

Yep, Psych.load seems to be the way to go for the newer version, instead of YAML.load. Judging from other gems, something like this should be done:

if defined?(Psych) and defined?(Psych::VERSION)
  Psych.load(yaml_string)
else
  YAML.load(yaml_string)
end

@geoffharcourt could you try out replacing the existing YAML.load statement with the snippet above and see if that fixes it?

Still mysterious why me and @segiddins can't reproduce it. I think @alloy magic will be required to understand it :)

@segiddins

This comment has been minimized.

Copy link
Member

segiddins commented Dec 16, 2014

YAML is aliased to Psych in ruby 1.9.3 and later.

-Samuel E. Giddins

On Dec 16, 2014, at 3:15 PM, Boris Bügling notifications@github.com wrote:

Yep, Psych.load seems to be the way to go for the newer version, instead of YAML.load. Judging from other gems, something like this should be done:

if defined?(Psych) and defined?(Psych::VERSION)
Psych.load(yaml_string)
else
YAML.load(yaml_string)
end
@geoffharcourt could you try out replacing the existing YAML.load statement with the snippet above and see if that fixes it?

Still mysterious why me and @segiddins can't reproduce it. I think @alloy magic will be required to understand it :)


Reply to this email directly or view it on GitHub.

@neonichu

This comment has been minimized.

Copy link
Member

neonichu commented Dec 16, 2014

@segiddins my bad - that's why I couldn't figure out where YAML was defined :)

@geoffharcourt

This comment has been minimized.

Copy link

geoffharcourt commented Dec 16, 2014

@neonichu, assuming from @segiddins' comment that your instructions wouldn't fix the problem (I attempted JIC and no joy there).

@runv

This comment has been minimized.

Copy link

runv commented Apr 13, 2015

Please reopen the issue. I have this problem too and version of gem psych is 2.0.13:

*** LOCAL GEMS ***

activesupport (4.2.1)
awesome_print (1.6.1)
bigdecimal (1.2.4)
builder (3.2.2)
bundler (1.6.2)
bundler-unload (1.0.2)
calabash-common (0.0.1)
calabash-cucumber (0.12.3)
CFPropertyList (2.3.1)
claide (0.8.1)
clamp (0.6.4)
cocoapods (0.36.3)
cocoapods-core (0.36.3)
cocoapods-downloader (0.9.0)
cocoapods-plugins (0.4.2)
cocoapods-trunk (0.6.0)
cocoapods-try (0.4.3)
colored (1.2)
cucumber (1.3.19)
diff-lcs (1.2.5)
edn (1.0.6)
escape (0.0.4)
executable-hooks (1.3.2)
fuzzy_match (2.0.4)
gem-wrappers (1.2.4)
geocoder (1.2.8)
gherkin (2.12.2)
httpclient (2.6.0.1)
i18n (0.7.0)
io-console (0.4.2)
json (1.8.2, 1.8.1)
json_pure (1.8.1)
mime-types (1.25.1)
mini_portile (0.6.2)
minitest (5.5.1, 4.7.5)
molinillo (0.2.3)
multi_json (1.11.0)
multi_test (0.1.2)
nap (0.8.0)
netrc (0.7.8)
nokogiri (1.6.6.2)
open4 (1.3.4)
psych (2.0.13)
rack (1.6.0)
rack-protection (1.5.3)
rake (10.1.0)
rdoc (4.1.0)
rest-client (1.6.8)
retriable (1.4.1, 1.3.3.1)
rubygems-bundler (1.4.4)
rubyzip (1.1.6)
run_loop (1.2.9)
rvm (1.11.3.9)
sim_launcher (0.4.13)
sinatra (1.4.6)
slather (1.6.0)
slowhandcuke (0.0.3)
test-unit (2.1.2.0)
thor (0.19.1)
thread_safe (0.3.5)
tilt (2.0.1)
tzinfo (1.2.2)
xamarin-test-cloud (0.9.35)
xcodeproj (0.23.1)

@neonichu

This comment has been minimized.

Copy link
Member

neonichu commented Apr 13, 2015

Doesn't make sense to reopen if there is nothing actionable we can do about it. If you have found this to be an actual issue in CocoaPods, please share.

@ghost

This comment has been minimized.

Copy link

ghost commented Apr 20, 2015

Similar issue, with a twist: Cocoapods 0.36.3 works fine, and has for weeks.

I just upgraded to Cocoapods 0.36.4 and now getting these errors:

✗ pod update
Update all pods
[!] ERROR: Parsing unable to continue due to parsing error:
contained in the file located at /Users/joel/git/BoxbeeStorage/Frisbee/Podfile.lock

✗ rm -rf ~/.cocoapods
✗ pod install
Analyzing dependencies
Creating shallow clone of spec repo `master` from `https://github.com/CocoaPods/Specs.git`
[!] Unable to add a source with url `https://github.com/CocoaPods/Specs.git` named `master`.
You can try adding it manually in `~/.cocoapods/repos` or via `pod repo add`.

✗ pod --version
0.36.4

✗ env | grep LANG
LANG=en_US.UTF-8
@esetnik

This comment has been minimized.

Copy link

esetnik commented Apr 22, 2015

I disagree with @kashif. psych-2.0.13 does not work for me. The only thing that works is reverting back to psych-2.0.8 that is bundled with ruby-2.2.1.

$ gem list
*** LOCAL GEMS ***
psych (2.0.8)

$ ruby -v
ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-darwin14]

$ pod update
Update all pods
Analyzing dependencies
...
Generating Pods project
Integrating client project

$ gem update psych
Updating installed gems
Updating psych
Fetching: psych-2.0.13.gem (100%)
Building native extensions.  This could take a while...
Successfully installed psych-2.0.13
Parsing documentation for psych-2.0.13
Installing ri documentation for psych-2.0.13
Installing darkfish documentation for psych-2.0.13
Done installing documentation for psych after 2 seconds
Parsing documentation for psych-2.0.13
Done installing documentation for psych after 1 seconds
Gems updated: psych

$ pod update
Update all pods
[!] ERROR: Parsing unable to continue due to parsing error:

$ gem uninstall psych
Successfully uninstalled psych-2.0.13

$ pod update
Update all pods
Analyzing dependencies
...
Generating Pods project
Integrating client project
@kashif

This comment has been minimized.

Copy link

kashif commented Apr 22, 2015

dear @esetnik yes it seems the error you get now is not the original error of this issue... any idea what the missing line is?

@esetnik

This comment has been minimized.

Copy link

esetnik commented Apr 22, 2015

The psych problem seems to cause both:

$ pod update
Update all pods
[!] ERROR: Parsing unable to continue due to parsing error:

and

$ pod setup
Setting up CocoaPods master repo
[!] There was an error reading '/Users/geoff/.cocoapods/repos/master/CocoaPods-version.yml'.
Please consult http://blog.cocoapods.org/Repairing-Our-Broken-Specs-Repository/ for more information.

The latter was the original reported issue. I'm just sharing that this issue is larger than just a broken pod setup it's also about pod update as well. It looks like @SixArm also reports the same.

@kashif

This comment has been minimized.

Copy link

kashif commented Apr 22, 2015

@esetnik can you also kindly try with cocopods beta? 0.37.0.beta.1

@esetnik

This comment has been minimized.

Copy link

esetnik commented Apr 22, 2015

Not working on the beta unfortunately.

$ gem install cocoapods --pre
Fetching: xcodeproj-0.24.0.gem (100%)
Successfully installed xcodeproj-0.24.0
Fetching: cocoapods-core-0.37.0.beta.1.gem (100%)
Successfully installed cocoapods-core-0.37.0.beta.1
Fetching: cocoapods-0.37.0.beta.1.gem (100%)
Successfully installed cocoapods-0.37.0.beta.1
Parsing documentation for xcodeproj-0.24.0
Installing ri documentation for xcodeproj-0.24.0
Parsing documentation for cocoapods-core-0.37.0.beta.1
Installing ri documentation for cocoapods-core-0.37.0.beta.1
Parsing documentation for cocoapods-0.37.0.beta.1
Installing ri documentation for cocoapods-0.37.0.beta.1
Done installing documentation for xcodeproj, cocoapods-core, cocoapods after 7 seconds
3 gems installed

$ pod update
Update all pods
[!] ERROR: Parsing unable to continue due to parsing error:

$ gem uninstall psych
Successfully uninstalled psych-2.0.13

$ pod update
Update all pods
Analyzing dependencies
...
@softroots

This comment has been minimized.

Copy link

softroots commented Apr 24, 2015

That was a headache - Thanks @csknns

@tallesborges

This comment has been minimized.

Copy link

tallesborges commented May 2, 2015

rvm use 2.2.1 fixed for me.

@giacgbj

This comment has been minimized.

Copy link

giacgbj commented May 7, 2015

@dmi3j's solution works if the following error occurs using Cocoapods 0.37.1 and Psych 2.0.13.

$  pod setup
Setting up CocoaPods master repo
[!] There was an error reading '/Users/jhack/.cocoapods/repos/master/CocoaPods-version.yml'.
Please consult http://blog.cocoapods.org/Repairing-Our-Broken-Specs-Repository/ for more information.
@segiddins

This comment has been minimized.

Copy link
Member

segiddins commented Jun 1, 2015

Also reported at rubocop-hq/rubocop#1510 -- someone said it might be a RubyGems bug?

@samtheprogram

This comment has been minimized.

Copy link

samtheprogram commented Jun 26, 2015

Could this occur to someone who uses rbenv without proper maintenance / rehashing? Or is it a general problem that will occur with updating gems in general? I just had the same problem; pod broke after gem update with issues related to the version.yml.

Rehashing (if you use rbenv), removing CocoaPods / ~/.cocoapods, followed by gem update --system fixed this for me if anyone is still stuck on this.

@geoffharcourt

This comment has been minimized.

Copy link

geoffharcourt commented Jun 27, 2015

This issue happened to me even after rehashing.
On Jun 27, 2015 1:08 AM, "Sam Moore" notifications@github.com wrote:

Could this occur to someone who uses rbenv without proper maintenance /
rehashing? Or is it a general problem that will occur with updating gems in
general? I just had the same problem; pod broke after gem update.


Reply to this email directly or view it on GitHub
#2908 (comment)
.

@hliya07

This comment has been minimized.

Copy link

hliya07 commented Jul 2, 2015

There was an error reading '/Users/sotsys0156/.cocoapods/repos/master/CocoaPods-version.yml

Solved by using following command:

sudo rm -fr ~/.cocoapods/repos/master/CocoaPods-version.yml

@cmavromoustakos

This comment has been minimized.

Copy link

cmavromoustakos commented Jul 16, 2015

This did it for me:

gem cleanup 

The instructions that were given on the website given by CL were not valid.

The instructions that did not work for me were: http://blog.cocoapods.org/Repairing-Our-Broken-Specs-Repository/

@iosappdeveloper

This comment has been minimized.

Copy link

iosappdeveloper commented Sep 12, 2015

gem cleanup worked for me too.

Background: Initially I had gem list gave me psych (2.0.15, 2.0.5, 2.0.0) . After reading about comments, I performed gem uninstall psych which left me with gem list of psych (2.0.15, 2.0.5, 2.0.0) .. Then I did gem cleanup and follow up pod install worked immediately.

xfreebird added a commit to xfreebird/mobile-ci-bootstrap that referenced this issue Oct 5, 2015

xfreebird added a commit to xfreebird/mobile-ci-bootstrap that referenced this issue Oct 5, 2015

@cybercatgurrl

This comment has been minimized.

Copy link

cybercatgurrl commented Oct 13, 2015

Seems to me that removing the psych gem fixes this completely. I wonder what continues to cause this to be an issue. The installed version of psych was psych-2.0.15.

@wolffan

This comment has been minimized.

Copy link

wolffan commented Oct 19, 2015

Doing

  • gem cleanup
    -pod install worked

worked as well

@longbowww

This comment has been minimized.

Copy link

longbowww commented Oct 19, 2015

also ran into this today, but neither fixes worked for me

ended up checking out a pre-update version from my git

@vinibaggio

This comment has been minimized.

Copy link

vinibaggio commented Oct 24, 2015

Reverting psych (from 2.0.15 to 2.0.8) fixed this for me as well.

@orta orta referenced this issue Nov 13, 2015

Closed

Pod install fails #4542

@mikumaycry

This comment has been minimized.

Copy link

mikumaycry commented Dec 6, 2015

I reinstalled ruby, cocoapods...but only Reverting psych to 2.0.0 works

@SpikeyCoder

This comment has been minimized.

Copy link

SpikeyCoder commented Dec 25, 2015

Thank you for posting the psych version fix! Major help and fixed this for me as well.

@zirinisp

This comment has been minimized.

Copy link

zirinisp commented Nov 29, 2016

sudo gem cleanup
did the trick for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment