CocoaPods No such file or directory - objective-c

I just installed CocoaPods and cannot seem to run any commands.
All the follow commands give the same error:
$ pod init
$ pod setup
$ pod install
Error:
-bash: /Users/emma/.rvm/rubies/ruby-2.2.0/bin/pod: No such file or directory

Correct way to install Cocoapods is with the following Terminal commands (in this order):
sudo gem update --system
sudo gem install cocoapods
pod setup
cd ~/Path/To/Folder/Containing/YourApp
pod init
After pod init you should be able to open and edit the podfile
open -a Xcode Podfile
And add your pod to it (f.e.:)
pod 'AFNetworking', '2.2.1'
to install the added pods run command pod install
After the installation of the pods, use *.xcworkspace instead of *.xcodeproj
A clear tutorial can be found on the good 'ol RayWenderlich website.

Related

Cocoapods is not available, make sure it's installed and in your PATH

After execution sudo eas build -p ios --profile production --local
catching such a mistake
Cocoapods is not available, make sure it's installed and in your PATH
pod exited with non-zero code: 1
Try running sudo gem install -n /usr/local/bin cocoapods

Cocoapods is failing to download dependencies(APPLE M1) in the time of react-native development set up

This is the screenshot of the current situation. Its a Brand new Apple M1 MacBook. react is working fine but React-native is not getting installed properly. Tried various solutions but no luck.
First install node, watchman, cocoapods using brew.
brew install node
brew install watchman
brew install cocoapods
If the machine is M1,
sudo gem update --system
arch -x86_64 sudo gem install cocoapods
arch -x86_64 sudo gem install ffi
then you should be able to work using react-native apps.
If you are getting cocoapods error while creating react-native app using,
npx react-native init app-name
you can go to the app-name/ios and install cocoapods there by,
arch -x86_64 pod install
You should have Xcode Command Line Tools beforehand.
And check whether the simulator can be used with Xcode by,
xcrun -k --sdk iphoneos --show-sdk-path
If it is showing errors,
sudo xcode-select --switch /Applications/Xcode.app
to fix it.

Xcode 6 and Cocoapods using versions 0.34.4 & cocoapods-0.35.0.rc2

I have a problem with cocoapods using versions 0.34.4 & cocoapods-0.35.0.rc2
After I updated my laptop to OS X Yosemite I had to update gems and cocoapods and my old iOS project stop working
I'm getting the following errors:
using cocoapods-0.34.4:
ld: library not found for -lPods-Evernote-SDK-iOS
clang: error: linker command failed with exit code 1 (use -v to see invocation)
using cocoapods-0.35.0.rc2:
There is a circular dependency between ShareKit/NoARC and ShareKit/Core
Here is my podfile contents, Any Help ??
platform :ios, '6.0'
source 'https://github.com/CocoaPods/Specs.git'
pod 'CXAlertView'
pod 'ShareKit'
pod 'JSONKit'
pod 'FPPopover'
pod 'Base64'
pod 'CZDateFormatterCache'
pod 'JMImageCache'
pod 'Reachability'
pod 'MFSideMenu'
pod 'ASIHTTPRequest'
Remove your current 0.35.0 version you could just run:
sudo gem uninstall cocoapods
you must install a specific version of cocoa pods via the command:
sudo gem install cocoapods -v 0.34.4
than pod install
Solved by creating new project!
I used cocoapods-0.34.4 with the new project

Updating a pod (cocoapods)?

The first version I released for my framework was 1.0.0.
I just finished version 1.1.0 and wanted to update the the version in cocoa pods.
Steps I did:
Updated podspec file (Changed the version and tag to 1.1.0 and added a framework that I needed).
I first pushed the changes to Github using the Github for Mac app
Ran pod lib lint and passed validation
Entered git add -A && git commit -m "Release 1.1.0" and got a weird (Your branch is ahead of 'origin/master' by 1 commit).
Entered git tag '1.1.0'
Entered git push --tags (and it said everything was good and it showed 1.1.0 passing).
When I search my framework in pod search "name" it still shows 1.0.0 as the version.
Did I miss something or does it take some time to update?
You just follow the below terminal commands.
While your going to update your pods you just focus on the below terminal commands.These commands are more than enough for update your pods. Hope it may help you.
Open the Terminal:
$sudo gem update —system
$sudo gem uninstall cocoapods
$sudo gem install cocoapods
$pod setup
$cd <project path>
$pod init
$ open -a Xcode Podfile
add files(framework name) into to your pod file.
Example:
platform :ios, '7.0'
pod 'FBSDKLoginKit'
pod 'FBSDKCoreKit'
pod 'FBSDKShareKit'
pod 'FBAudienceNetwork'
pod 'FBSDKMessengerShareKit'
Save your pod file. then,
$pod install
$pod update(if you need)
The frameworks will downloading the latest version, if we are not mentioning the version name (Ex:
pod 'AFNetworking', '~> 2.5'
)
platform :ios, '7.0' (The version 7.0 is your Deployment target)
Open your project folder --> Open the project workspace not the Xcode project.
Clean the Project.
Run the Project.
Hope it will useful for you.!
Thanks.
please refer to cocoapods spec Cocoa guid
You can use
pod trunk push NAME.podspec
Your steps 4,5,6 is not necessary.

Cannot install cocoapods 0.29

I successfully install cocoapods 0.29, and after attempting to run pod setup, it claims I must install 0.29.
Can someone please explain this to me??
Successfully installed cocoapods-0.29.0
Parsing documentation for cocoapods-0.29.0
1 gem installed
bash-3.2$ pod setup
Setting up CocoaPods master repo
Already up-to-date.
[!] The `master` repo requires CocoaPods 0.29.0 -
Update CocoaPods, or checkout the appropriate tag in the repo.
UPDATE:
After updating cocoapods, I am able to run pod setup, however still getting some error about 0.29 not being installed: (And also, when running pod --version, it says I'm on 0.22.3???)
bash-3.2$ sudo gem update cocoapods
Updating installed gems
Nothing to update
bash-3.2$ sudo pod setup
Setting up CocoaPods master repo
Already up-to-date.
Setup completed (read-only access)
bash-3.2$ pod install
Setting up CocoaPods master repo
Already up-to-date.
[!] The `master` repo requires CocoaPods 0.29.0 -
Update CocoaPods, or checkout the appropriate tag in the repo.
/Users/me/.rvm/gems/ruby-2.0.0-p247/gems/claide-0.3.2/lib/claide/command.rb:210:in `rescue in run': undefined method `verbose?' for nil:NilClass (NoMethodError)
bash-3.2$ pod --version
0.22.3
navigate this file and delete it
/Users/me/.rvm/gems/ruby-2.0.0-p247/gems/claide-0.3.2/lib/claide
then open ur terminal add this
sudo gem update
its worked for me 100%
Based on your comment
$ type -a pod
pod is /Users/me/.rvm/gems/ruby-2.0.0-p247/bin/pod
pod is /Users/me/.rvm/rubies/ruby-2.0.0-p247/bin/pod
pod is /usr/bin/pod
it appears you have multiple installations of Cocoapods: one with gem install cocoapods in /Users/me/.rvm/gems/ruby-2.0.0-p247/bin/pod and another with sudo gem install cocoapods in /usr/bin/pod (I don't know what /Users/me/.rvm/rubies/ruby-2.0.0-p247/bin/pod is).
So running gem install cocoapods should fix the problem by updating the install in /Users/me/.rvm/gems/ruby-2.0.0-p247/bin/pod.
I'd recommend cleaning up your install though by removing either the global (with sudo) one or the local (without sudo) one.
EDIT:
Here's my Jenkins install:
Installed Cocoapods with gem install cocoapods.
Running type -a pod yield:
$ type -a pod
pod is /Users/Shared/Jenkins/Home/gems/bin/pod
In the Jenkins global config, I added the following environment variables:
GEM_HOME = $JENKINS_HOME/gems
GEM_PATH = $JENKINS_HOME/gems:/usr/lib/ruby/gems/1.8/
PATH = $PATH:$HOME/gems/bin
I added a "Shell script" build step to each project with:
POD_PROJECT_DIRECTORY='MyProject' # Directory where the Podfile is. Probably the same as Xcode plugin's "Xcode Project Directory".
cd "$WORKSPACE/$POD_PROJECT_DIRECTORY"
# rm -rf ./Pods # Uncomment this line if you want to re-download all the Pods each time
pod install --no-color
I found the mismatch of version reported by 'pod --version' and what I was seeing when I updated to be mystifying. Then I realized I had more than one ruby installed on my machine. I changed my $PATH so that the ruby I needed to use came first (e.g. /usr/local/opt/ruby/bin):
In a new shell I found that 'pod --version' started reporting the '0.29.0' version I wanted.