Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to run pod install in project directory

A tutorial tells me to run pod install in the project directory. Can anyone tell me how to do that?

like image 589
Katie Avatar asked May 23 '15 22:05

Katie


3 Answers

  1. Open Terminal.

  2. If you haven't already done so, run this command:

    sudo gem install cocoapods
    

    Wait for it to finish before proceeding.

  3. Find the project directory in the Finder. This should be the folder that has the Xcode project in it.

  4. Type cd into the terminal, followed by a space.

  5. Drag and drop the project directory into the terminal window. It should now say something like this:

    cd /Users/someone/Downloads/WonderfulProject
    
  6. Press return.

  7. Now type pod install. Wait for that to finish. It could take a while.

Done!

like image 79
tbodt Avatar answered Oct 12 '22 20:10

tbodt


Close your Xcode project before you carry out the following steps.

  1. First check if you have cocoapods installed. For this, type pod --version into the terminal and if a version no. is returned, you are good to move on to step 3.
  2. If not installed, install cocoapods using the command sudo gem install cocoapods in terminal.
  3. Next type cd and name of your Xcode project directory
  4. Type pod init in terminal. This adds the podfile into your project where you can make edits.
  5. Next type pod install.

Now, if a Podfile already exists in your Xcode project folder, for example if the tutorial already added it into the project for you, then you can just carry out step 5, provided you have cd-ed into your Xcode project directory.

like image 26
cheznead Avatar answered Oct 12 '22 21:10

cheznead


This actually can happen because the pod install might have problems when resolving the base directory when going through dependencies. Happens especially with react-native projects.

You have two options.

  1. Use cd ./dir and run pod install

    cd ./project-directory && pod install

  2. Use flag for project directory pod install --project-directory=project-dir

    pod install --project-directory=project-dir

like image 24
twboc Avatar answered Oct 12 '22 21:10

twboc