CocoaPods setup issues when adding mailgun library to iOS project

I successfully installed cocoapods on my Mac using the gem install command. Now I’m trying to add the mailgun email service library to my iOS app but running into problems.

When I try to run this command:

pod 'EmailService', '~> 1.0.2'

I get an error saying the pod command cannot be found. I’m confused about the proper workflow here. Do I need to run this from my project directory? Also, I was hoping to place the mailgun files in my project’s Supporting Files folder but I’m not sure if that’s the right approach.

Anyone who has successfully integrated mailgun into an Objective-C iOS project - what steps did you follow to get the library properly installed and working?

had the same issue last week. you can’t run pod 'EmailService', '~> 1.0.2' directly in terminal - that’s Podfile syntax, not a command. add that line to your Podfile first, then run pod install.

It seems like you’re encountering issues with your CocoaPods setup. First, ensure that you’re in the correct project directory within your terminal before running any pod commands. You do not need to manually add Mailgun files to your Supporting Files folder, as CocoaPods will manage and integrate the library automatically. Start by running pod init to create a Podfile if you haven’t done that yet. Then, add your dependency there and execute pod install. After installing, make sure to always open the generated .xcworkspace file to work on your project.

The “pod command not found” error indicates that CocoaPods might not be added to your PATH. To resolve this, try running gem install cocoapods again and check the installation using pod --version. If the issue persists, consider using sudo gem install cocoapods, as it can depend on how Ruby is configured on your system. Once CocoaPods is properly installed, navigate to your project’s root directory and create a Podfile using any text editor. Ensure you include the EmailService dependency inside the target block and execute pod install. I have had success integrating similar email libraries in Objective-C, so just confirm that your Podfile syntax is correct and that you import the necessary headers correctly in your implementation files.