Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Permission denied (publickey) on pod setup

I've been using cocoa pods for a while now, and it's been working just fine. Yesterday it stopped working. I get:

[!] 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'.

on pod install and

[!] /usr/bin/git clone https://github.com/CocoaPods/Specs.git master

Cloning into 'master'...
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

on pod setup and similar when I clone into repos directory with git clone.

I've searched for every solution and none of them have worked - at first I thought it was the cyber attack which affected GitHub on Oct. 21 but I changed my DNS settings and got it working fine. I also suspected it had something to do with using SSH keys but I'm using HTTPS. I also don't really use GitHub - I work with GitLab so it's not like I messed with any settings but that shouldn't matter because I'm not using SSH.

Any information you need or I may have missed feel free to ask for.

Any help would be much appreciated!!!

Specifics: I've tried the latest cocoa pods and the prerelease (uninstalled and reinstalled multiple times (used sudo as suggested)). Using Xcode 8. Swift 3 (not relevant but thought I'd include it anyways).

like image 846
CoolPenguin Avatar asked Oct 22 '16 21:10

CoolPenguin


2 Answers

One thing you could try is to setup you Pods repo again after erasing the already existing folder by running:

rm -rf ~/.cocoapods/repos/master && pod setup

Perhaps you'll need sudo if you accidentally ran it as root before.

Also, how did you change your DNS settings? Perhaps setting it back as the DNS is back to normal may solve it. Another thing you could try is making sure git is working for other public repositories.

like image 192
andresk Avatar answered Nov 03 '22 02:11

andresk


I needed to (re)create an SSH key and install it on my computer as instructed. Check out here for more info https://help.github.com/articles/error-permission-denied-publickey/.

like image 42
CoolPenguin Avatar answered Nov 03 '22 03:11

CoolPenguin