I am trying to create a Podfile for my Xcode project for Firebase compatibility, but when I try to create it within the same file that my Xcode project is stored in, using my te
if the 1st command doesn't work, try the 2nd command
sudo gem install cocoapods
sudo gem install -n /usr/local/bin cocoapods
In my case, the 2nd command worked
Looks like you didn't install CocoaPods.
To do that you install it through ruby gems, like this:
sudo gem install cocoapods
If you don't have admin privileges, try:
gem install cocoapods --user-install
Got this error today. Was able to resolve it by making sure I had ruby
in my PATH
.
export PATH=/usr/bin/ruby:$PATH
Then (as suggested by answers above) run
sudo gem install cocoapods
Or
sudo gem install -n /usr/local/bin cocoapods
I ran into this problem yesterday, I reckon others in my situation will be too. So I am running a mac OS siera on a virtual machine on my windows so I can use xcode. Firstly you will need to update your version of ruby, it has been answered here: https://stackoverflow.com/a/38194139/7451779.
Once updated this just run: $ sudo gem install cocoapods
After all this $ pod init should work
$ brew install cocoapods
For me sudo gem install cocoapods
did not work.
When I tried $sudo gem install -n /usr/local/bin cocoapods
it threw me weird error messages. But brew install
was pretty neat.
For OS Catalina (as of December 2019)
gem install -n /usr/local/bin cocoapods