我参考了许多链接并尝试了,但我没有成功。我阅读了CocoaPods文档,并多次尝试安装,但总是因为初始步骤而失败。我发现了一个错误,我不能先安装宝石。一个一个的步骤是什么?例如如何安装的步骤或演示。
这是我尝试过的一个链接。
截图指的是我得到的这个控制台错误:
我参考了许多链接并尝试了,但我没有成功。我阅读了CocoaPods文档,并多次尝试安装,但总是因为初始步骤而失败。我发现了一个错误,我不能先安装宝石。一个一个的步骤是什么?例如如何安装的步骤或演示。
这是我尝试过的一个链接。
截图指的是我得到的这个控制台错误:
当前回答
Pod安装在Mac OS X v10.11.2 (El Capitan)上出现错误:
安装cocoapods时出错: activesupport要求Ruby版本>= 2.2.2。
在得到这个错误后,我尝试了这个命令并重新安装。这对我很管用。
sudo gem install activesupport -v 4.2.6
现在尝试相同的pod安装命令
sudo gem install -n /usr/local/bin cocoapods
其他回答
如果你在代理后面,那么将代理作为参数传递:
sudo gem install --http-proxy http://user:password@www-proxy.example.com:80 cocoapods
2020年,在macOS v10.15 (Catalina)中安装CocoaPods v1.9.1
首先在Mac上使用终端设置Xcode版本。 sudo xcode-select -switch /Applications/Xcode.app 接下来,使用终端安装CocoaPods。 Sudo gem安装cocoapods
更多信息,请访问官方网站https://cocoapods.org/。
容器安装
Open terminal and type: sudo gem install cocoapods The Gem will get installed in Ruby inside the System library. Or try on Mac OS X v10.11 (El Capitan), type: sudo gem install -n /usr/local/bin cocoapods If there is an error "activesupport requires Ruby version >= 2.xx", then install latest activesupport first by typing in the terminal. sudo gem install activesupport -v 4.2.6 After installation, there will be a lot of messages. Read them and if no error found, it means the CocoaPods installation is done. Next, you need to setup the CocoaPods master repository. Type in the terminal: pod setup And wait it will download the master repository. The size is very big (370.0 MB in December 2016). So it can be a while. You can track of the download by opening Activity and go to the Network tab and search for "git-remote-https". Alternatively, you can try adding "--verbose" to the command like so: pod setup --verbose Once done, it will output "Setup Complete", and you can create your Xcode project and save it. Then in the terminal, cd to your Xcode project root directory (where your .xcodeproj file resides) and type: pod init Then open your project's podfile by typing in terminal: open -a Xcode Podfile Your Podfile will get open in text mode. Initially there will be some default commands in there. Here is where you add your project's dependencies. For example, in the podfile, type pod 'AFNetworking', '0.9.1' (This line is an example of adding the AFNetworking library to your project.) Other tips: Uncomment platform :ios, '9.0' Uncomment use_frameworks! if you're using Swift When you are done editing the podfile, save it and close Xcode. Then install pods into your project by typing in terminal: pod install or (For m1 chip) arch -x86_64 pod install Depending how many libraries you added to your podfile for your project, the time to complete this varies. Once completed, there will be a message that says "Pod installation complete! There are X dependencies from the Podfile and X total pods installed." Now close your Xcode project. Then locate and open the .xcworkspace Xcode project file and start coding. (You should no longer open the xcodeproj file.)
检查这个
gem install -p http://proxy_ip:proxy_port compass
你可能需要添加你的用户名和密码:
gem install -p http://[username]:[password]@proxy_ip:proxy_port compass
检查这个链接,它可能会帮助你。
对于终端中的CocoaPods,请遵循以下命令:
sudo gem update
sudo gem install cocoapods
pod setup
cd (project direct drag link)
pod init
open -aXcode podfile # (If it’s already open, add your pod file name. Example: alamofire4.3)
pod install
pod update