简体   繁体   English

-bash: pod: 命令未找到

[英]-bash: pod: command not found

I am taking a course from Udemy for iOS 10 (swift 3) programming.我正在学习 Udemy 的 iOS 10 (swift 3) 编程课程。 An app works with Firebase and Firebase requires a pod file.应用程序与 Firebase 配合使用,而 Firebase 需要一个 pod 文件。 In the course, it said to type the following commands in Terminal to install a pod:在课程中,它说在终端中键入以下命令来安装一个 pod:

          cd Desktop/
          ln
          cd dc-social
          ln
          pod init

But when I run the pod init command, it gives me an error:但是当我运行 pod init 命令时,它给了我一个错误:

      -bash: pod: command not found

I am running macOS Sierra (the final release).我正在运行 macOS Sierra(最终版本)。 What should I do?我该怎么办? Any help would be appreciated :) Thanks!任何帮助将不胜感激:) 谢谢!

尝试先运行此命令(它将询问您的管理员密码)

sudo gem install -n /usr/local/bin cocoapods

I am in the same course and got the same problem. 我在同一课程中,遇到了相同的问题。 I found out that we have to install cocapods before we run that command. 我发现在运行该命令之前必须先安装cocapods So do the following in your terminal (it will ask for your password): 在您的终端中执行以下操作(它将要求您输入密码):

sudo gem install cocoapods

This will install some stuff and then you will be able to run the "init pod command". 这将安装一些东西,然后您将能够运行“ init pod command”。

Maybe a little late, but often you can't do a sudo when your not an admin. 也许有点晚了,但是当您不是管理员时,您通常无法做sudo。 Then do this, open the terminal. 然后,执行此操作,打开终端。 Change to an admin user with 更改为admin用户

su 'theadminName'

Type the admin password. 输入管理员密码。 Then do 然后做

sudo gem install cocoapods

getting errors with this command: sudo gem install cocoapods使用此命令出错: sudo gem install cocoapods

brew install cocoapods => works for me brew install cocoapods => 对我brew install cocoapods

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM