Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialChris Smith
6,791 PointsCocoaPods install issues. Please help.
Hi, I seem to have installed CocoaPods via the Terminal. The text read "installing CocoaPods" then, "CocoaPods 39.0 installed", I then closed the Terminal program. However, I didn't see the additional text below as shown in the video.
I then continued by following the example:
- I entered: pod 'SAMGradientView' into 'podfile' in Xcode.
- Reopened the Terminal.
- I then entered "cd" into the Terminal, then dragged the Example Xcode Project file to the Terminal. I then pressed enter and nothing happened.
I hope i've made sense. What am I doing wrong? Have I installed CocoaPods correctly? Help would be much appreciated. Thanks in advance.
3 Answers
Steven Deutsch
21,046 PointsHey Chris Smith,
You can also use CocoaPods like this:
1) Open terminal and navigate into the project directory
2) Type pod init inside of your terminal. This will create a Podfile in the directory
3) Type nano Podfile this will open the Podfile you just created in the nano editor. You can also use a text editor.
4) If you are using Swift, uncomment the line that says: use_frameworks!
5) Under the section where it says target 'YourProjName' do list the pod you want to install pod 'GradientView'
6) Exit out of the text editor and save your changes, CTRL+X then Y for nano
7) Make sure your Xcode project is closed, then run pod install in the terminal
8) You should be notified if the installation was successful. If it is, you will now have a white workspace version of your Xcode project to work with. Use this version from now on.
Good Luck
Chris Smith
6,791 PointsUnfortunately, i'm still struggling.
Steven Deutsch
21,046 PointsHave you tried my method above?
Chris Smith
6,791 PointsYep, thanks for your help but I feel very lost with this one. I've repeatedly followed this tutorial.
1) I opened up the "Example" Xcode project, then entered: pod 'SAMGradientView' into the podfile (within the project navigator).
2) I opened up the Terminal, then entered: "cd".
3) I then dragged the "Example" project file to the Terminal, then pressed enter. After pressing enter nothing happened. I expected to see some text below, as shown in the tutorial.
Steven Deutsch
21,046 PointsI see. I checked out the CocoaPod and it says the name is 'GradientView' and not 'SAMGradientView' I also run pod install
Chris Smith
6,791 PointsChris Smith
6,791 PointsThank you, but unfortunately this doesn't seem to work. I am using using Objective-C, would this make a difference? Thanks.
Chris Smith
6,791 PointsChris Smith
6,791 PointsWhen I went to install CocoaPods this displayed in the terminal: "Successfully installed cocoapods-0.39.0 Parsing documentation for cocoapods-0.39.0 1 gem installed"
I then continued by following the example:
1) I entered: pod 'SAMGradientView' into 'podfile' in Xcode.
2) Reopened the Terminal.
3) I then entered "cd" into the Terminal, then dragged the Example Xcode Project file to the Terminal. I then pressed enter and nothing happened.
Steven Deutsch
21,046 PointsSteven Deutsch
21,046 PointsI believe the name is just 'GradientView'