我正在尝试在Mac上安装CocoaPods。当我运行此命令时:
sudo gem install cocoapods
它返回此:
Fetching: cocoapods-core-1.5.3.gem (100%)
Successfully installed cocoapods-core-1.5.3
ERROR: Error installing cocoapods: invalid gem: package metadata is missing in /Library/Ruby/Gems/2.3.0/cache/cocoapods-deintegrate-1.0.2.gem
什么是套管问题?如何安装CocoaPods?
答案 0 :(得分:1)
如果您尚未使用Homebrew,则它是macOS的软件包管理器,在所有类型的开发人员中都非常受欢迎。它使安装CocoaPods之类的软件包变得无忧无虑。
要安装Homebrew,请按照homepage
上的说明进行操作。在终端提示下粘贴。
private void btnSubmit_Click(object sender, EventArgs e) { String fruitname = txtFruitName.Text; string appPath = @"D:\assets\"; if (txtFruitName.Text == "") { MessageBox.Show("Fruit Name Should be Filled"); } else { int newindex = 0; foreach (var item in path) { newindex += 1; string iName = item[newindex - 1, 1].Trim(); string iPath = item[newindex - 1, 0].Trim(); try { File.Copy(iPath, appPath + iName, true); File.SetAttributes(appPath, FileAttributes.Normal); } catch (Exception err) { MessageBox.Show(err.ToString()); //MessageBox.Show("Permission error or picture is already exists"); } path.Clear(); } MessageBox.Show("All Picture Has Been Saved"); lvFruit.Clear(); txtFruitName.Text = ""; btnDone.Enabled = true; } }
Homebrew需要安装和设置Xcode命令行工具(我假设您已经尝试安装CocoaPods时已经拥有,这意味着您正在为iOS开发)。
一旦设置了Homebrew,只需运行:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
安装CocoaPods。