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

"pod: command not found" after installing on OS X El Capitan Beta 2 #3736

Closed
danielbyon opened this issue Jun 25, 2015 · 69 comments
Closed

"pod: command not found" after installing on OS X El Capitan Beta 2 #3736

danielbyon opened this issue Jun 25, 2015 · 69 comments

Comments

@danielbyon
Copy link

Trying to setup an OS X Server Mac Mini with El Capitan Beta 2 so I can try out the new Xcode server stuff. I'm able to run "sudo gem install cocoapods", and it seems to install everything properly without errors, but when I run "pod setup" I get the command not found error. Happens even after closing the current Terminal window and opening a new one.

Is there an issue specific to the 10.11 beta? I've been able to install cocoapods on my other macs (albeit I installed cocoapods way before I installed the 10.11 beta on those machines)

@segiddins
Copy link
Member

What's the output of gem list ?

@leoMehlig
Copy link

I have the same problem.
cocoa pods gets install just fine and its also in the gem list, but I can't call any commands.

@neonichu
Copy link
Member

See #3692 (comment), binstubs are installed in a directory that is not part of the standard PATH when using OS X 10.11

@MarsCWD
Copy link

MarsCWD commented Sep 22, 2015

i have got the same problem...oh no ...

@yanko
Copy link

yanko commented Sep 30, 2015

I tried the #3690 but it still not finding the pod command line. tells me it does not exist.

@remirobert
Copy link

Same issue here. 👎

@wieseljonas
Copy link

Same for me

@neonichu
Copy link
Member

neonichu commented Oct 1, 2015

Piling on doesn't really help anyone — you have to tell us what you tried and why that didn't work for you.

@mgmart
Copy link

mgmart commented Oct 1, 2015

Got the same problem after upgrading to 10.11

gem install cocoapods solved it for me.

@richardgroves
Copy link

Update with solution:

sudo gem install -n /usr/local/bin cocoapods

will install 'pod' to a writeable place. From http://stackoverflow.com/a/32883578/701926 - give him an upvote if it helps you.

Original problem:

Same here - trying to re-install cocoapods fails:

richard$ pod install
-bash: pod: command not found
richard$ sudo gem install cocoapods
Password:
ERROR: While executing gem ... (Errno::EPERM)
Operation not permitted - /usr/bin/pod

I suspect it is related to:

http://arstechnica.co.uk/apple/2015/09/os-x-10-11-el-capitan-the-ars-technica-review/8/#h1

which would block an install to /usr/bin - should be to /usr/local/bin

Trying it without 'sudo' in case it then finds local places to install fails too:

richard$ gem install cocoapods
Fetching: cocoapods-0.38.2.gem (100%)
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory.

@neonichu
Copy link
Member

neonichu commented Oct 1, 2015

@richardgroves interesting, I guess there's a problem with existing installations in the El Capitan Ruby there. Could you try uninstalling and then reinstalling CocoaPods?

@MarsCWD
Copy link

MarsCWD commented Oct 1, 2015

@richardgroves
Copy link

@neonichu - Installing El Capitan wipes out the old version of cocoapods - the Ars Technica article has a link to where it 'migrates' all the files it finds in places it didn't like.

Hmmm....looks like the old versions are there - just the front end 'pod' launcher that got wiped:

richard$ pod --version
0.38.2
richard$ sudo gem uninstall cocoapods

Select gem to uninstall:

  1. cocoapods-0.32.1
  2. cocoapods-0.33.1
  3. cocoapods-0.34.1
  4. cocoapods-0.35.0
  5. cocoapods-0.35.0.rc2
  6. cocoapods-0.36.3
  7. cocoapods-0.37.1
  8. cocoapods-0.37.2
  9. cocoapods-0.38.0
  10. cocoapods-0.38.2
  11. All versions

    10
    Successfully uninstalled cocoapods-0.38.2
    richard$ which pod
    /usr/local/bin/pod
    richard$ pod --version
    0.38.0

So after uninstalling the 0.38.2 I still have the previous one working.

and then a straight install to get back to the latest fails:

richard$ sudo gem install cocoapods
Fetching: cocoapods-0.38.2.gem (100%)
ERROR: While executing gem ... (Errno::EPERM)
Operation not permitted - /usr/bin/pod
richard$ which pod
/usr/local/bin/pod

leaving me at 0.38.0 until I use the '-n /usr/local/bin' positioning argument.

@MarsCWD - that will work (disabling the whole SIP system) but is a bit heavy handed.

@neonichu
Copy link
Member

neonichu commented Oct 1, 2015

@richardgroves I can't reproduce this, if I uninstall all existing CP installations on OS X 10.11 and then reinstall, /usr/local/bin is used automatically.

@remirobert
Copy link

when i want reinstall cocoapods i got his :

sudo gem install cocoapods
ERROR:  Could not find a valid gem 'cocoapods' (>= 0), here is why:
          Unable to download data from https://rubygems.org/ - Errno::ECONNRESET: Connection reset by peer - SSL_connect (https://rubygems.org/latest_specs.4.8.gz)

@richardgroves
Copy link

@neonichu Interesting - I wonder if there is a config setting in Ruby gems that indicates where to put things? The machine I'm on has also done updates from several previous OS X versions so might have inherited an install location from an old version?

@neonichu
Copy link
Member

neonichu commented Oct 1, 2015

@richardgroves yah, I am assuming that is the case. I have updated the instructions in this comment to reflect the -n workaround if that happens. Thanks for reporting!

@MVakas
Copy link

MVakas commented Oct 3, 2015

Try the following command on OS X El Capitan
sudo gem install -n /usr/local/bin cocoapods

@TTVS
Copy link

TTVS commented Oct 3, 2015

thanks for your suggestion @MVakas. It solved the issue for me

@benjaminhorner
Copy link

@MVakas : thanks !! worked like a charm !
Guess we can close the issue.

@darioalessandro
Copy link

I just installed el capitan and ran into the same issue than you guys.

I did as @MVakas said, but I had to change permissions of /usr/local/bin/

with sudo chmod +rx /usr/local/bin/

@sicaboy
Copy link

sicaboy commented Oct 5, 2015

After running this command, solved
sudo chmod -R 755 /usr/local/bin

@richardgroves
Copy link

The config problem appears to be in /Library/Ruby/Site/2.0.0/rubygems/defaults.rb - around line 118:

The default directory for binaries

def self.default_bindir
if defined? RUBY_FRAMEWORK_VERSION then # mac framework support
'/usr/bin'
else # generic install
RbConfig::CONFIG['bindir']
end
end

it is setting up what is basically a not-allowed in OS X 10.11 directory to install binaries too. I'm on Ruby 2.0.0, so don't know if this is changed in the newer 2.2.3 build. The folder was the same back in 1.8 - http://stackoverflow.com/a/333639/701926

@neonichu
Copy link
Member

neonichu commented Oct 5, 2015

Interesting, that configuration file doesn't even exist on my 10.11 installation. Maybe it's an upgrade leftover in certain situations?

@richardgroves
Copy link

Just updated to 2.2.3 using brew & rbenv - so that has moved everything into a local folder in my user account which should solve future problems. Here's hoping the bad bindir setup is some legacy issue that will fade out rapidly.

@neonichu
Copy link
Member

neonichu commented Oct 5, 2015

I have filed a radar on this: http://www.openradar.me/22979372 — but pretty sure nothing will come out of it because it is way too vague.

@neonichu
Copy link
Member

neonichu commented Oct 7, 2015

Got a reply for the radar:

We need more information to investigate this issue.

What is your RubyGems version? If you've installed a newer version then it won't install into /usr/local/bin unless you use
-n /usr/local/bin
The rubygems shipped with El Capitan will report
$ gem env
...

  • EXECUTABLE DIRECTORY: /usr/local/bin
    ...

Please provide your response or results by updating your bug report.

Could y'all check your gem env and verify if you updated RubyGems?

@ghost
Copy link

ghost commented Oct 7, 2015

Gems version...
RUBY VERSION: 2.0.0 (2015-04-13 patchlevel 645) [universal.x86_64-darwin15]

After running .... sudo gem install -n /usr/local/bin cocoapods pod is available once more.

@iMuFeng
Copy link

iMuFeng commented Oct 19, 2015

@CoderMJLee I fix it with this.

@aitbaali
Copy link

I had the same issue after upgrading to 10.11.1
I've fixed it with:

$ sudo gem uninstall cocoapods
Remove executables:
    pod, sandbox-pod

in addition to the gem? [Yn]  Y

then

$  gem install cocoapods

@Nathan187
Copy link

@CatchZeng thanks...you helped me

@kbpontius
Copy link

+1 @the-scott-davis

@zhixia
Copy link

zhixia commented Oct 27, 2015

+1 @the-scott-davis Thanks a lot,it's worked.

@skyhacker2
Copy link

+1 @the-scott-davis

@skydivedan
Copy link

I was wondering if anyone has come across this running Xcode Server?

I tried the-scott-davis suggestions, and others, all to no avail.

I'm still getting the "pod: command not found." The weird thing is, Xcode Server runs as user _xcsbuildd. If I "su" to that user and do a "pod --version", no problem, it finds the command. But if I run a bot, with a script that has "pod install" in it, it's like the command doesn't exist. Any help would be greatly appreciated.

@anas10
Copy link

anas10 commented Oct 28, 2015

+1 I have the same problem as @skydivedan. I tried all the things I could but nothing worked yet.

@elviin
Copy link

elviin commented Oct 29, 2015

@the-scott-davis It works. Thank you.

@anas10
Copy link

anas10 commented Nov 2, 2015

@skydivedan I made it work easily at the end. Just do as @the-scott-davis said above and add one more step :
Add the following in your bot trigger script export PATH=$PATH:/usr/local/bin so that the bot can look there as well and find the binary.

Hope that helps.

@curzel-it
Copy link

You can also just run :
gem uninstall cocoapods
(All versions + Executables)
gem install cocoapods

Worked for me

@OliverNielsen
Copy link

Removing all versions and sandbox of CocoaPods and installing it again solved the problem for me.

Uninstall: sudo gem uninstall cocoapods
Install: sudo gem install cocoapods

@eluck
Copy link

eluck commented Dec 4, 2015

We can also make it work for local gem installation (a sudo-less one):

  1. Follow instructions from the official cocoapods installation guide: https://guides.cocoapods.org/using/getting-started.html#sudo-less-installation

  2. Run the following script:

    echo "export PATH=\$PATH$(gem env gempath)/bin" | sed 's/:/\/bin:/g' | sed 's/$PATH/$PATH:/g' >> ~/.bash_profile
    
  3. Restart terminal and run pod --help to check whether it works.

@damirkotoric
Copy link

@MVakas Legend!

@WillemKuei
Copy link

+1 @the-scott-davis Thanks!

@tyxinger
Copy link

I ran sudo "chmod +rx /usr/local/bin/" and It can work as before

@rajeshm20
Copy link

Thanks..everyone @MVakas...

@rsahu34
Copy link

rsahu34 commented May 5, 2016

Thanks... @MVakas

@skydivedan
Copy link

wait a minute.... Cocoapods 1.0 just rolled out. Shouldn't this have been addressed in the big 1.0 update? Or will "sudo gem install" always need a path argument?

@gpaluk
Copy link

gpaluk commented Sep 27, 2016

This happens because of a new security level in El Capitan, you can disable SIP or have the install use the -n flag along with the /usr/local/bin path however the route cause is the updated security model.

@SwamyChunchu
Copy link

SwamyChunchu commented Oct 4, 2016

i have tried all bellow Commands in os X 10.11.04 ....still iam getting this error
ERROR: While executing gem ... (NoMethodError)
undefined method `ord' for nil:NilClass

==>
sudo gem install -n /usr/local/bin cocoa pods

sudo gem install cocoapods
sudo gem install -n /usr/local/bin cocoapods
pod setup
pod setup --verbose

sudo gem install activesupport -v 4.2.6
sudo gem install cocoapods

sudo gem install activesupport -v 4.2.6
sudo gem install cocoa pods

sudo gem install -n /usr/local/bin cocoapods

[sudo] gem install activesupport -v 4.2.6
[sudo] sudo gem install cocoapods

sudo gem install cocoapods -V
sudo gem update --system

@RMKitty
Copy link

RMKitty commented Oct 16, 2016

@the-scott-davis help me, thanks
30802c42-3b72-44e6-ad98-43020d81a6d6

@SwamyChunchu
Copy link

Try this Commands

sudo gem install activesupport -v 4.2.6 ,
sudo gem install cocoa pods ,

sudo gem install cocoapods -V , sudo gem update --system

On Sunday, October 16, 2016, RMKitty notifications@github.com wrote:

@the-scott-davis https://github.com/the-scott-davis help me, thanks
[image: 30802c42-3b72-44e6-ad98-43020d81a6d6]
https://cloud.githubusercontent.com/assets/11688968/19415116/18de79e4-9398-11e6-9004-48bbd1fefe9d.png


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#3736 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AQ2yL8EzFc6fBRVSP_1V9KJEubuhzTfUks5q0aHlgaJpZM4FMQxG
.

@vistatinchao
Copy link

when i run pod setup
i found some error that
[!] /usr/bin/git clone https://github.com/CocoaPods/Specs.git master

Cloning into 'master'...
error: RPC failed; curl 56 SSLRead() return error -36
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed

how to solve
waiting..........

@hamidbin
Copy link

hamidbin commented May 1, 2022

sudo gem install -n /usr/local/bin cocoapods

Thanks, if you have installed cocoapads successfully, but :pod command not found, this is your solution. Don't listen to the cacophony around.

@IamSAL
Copy link

IamSAL commented Apr 20, 2024

Guys, I tried every solution and was getting crazy when nothing was working.

sudo gem uninstall cocoapods

sudo gem install -n /usr/local/bin cocoapods

It was still not working.

then I RESTARTED the mac, and it was all okay.

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