为CocoaPods插件设置Xcode [英] Setting up Xcode for CocoaPods plugin

查看:422
本文介绍了为CocoaPods插件设置Xcode的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试设置终端/ Xcode以正常运行 Xcode CocoaPods插件

I am trying to setup terminal/Xcode to work correctly for the Xcode CocoaPods Plugin.

当我从插件运行集成cocoapods选项时,我收到一条消息:

When I run integrate cocoapods option from the plugin I get a message:


[33m警告:CocoaPods要求您的终端使用UTF-8
编码。请参阅
https://github.com/CocoaPods/guides.cocoapods。 org / issues / 26 for
可能的解决方案。[0m

[33mWARNING: CocoaPods requires your terminal to be using UTF-8 encoding. See https://github.com/CocoaPods/guides.cocoapods.org/issues/26 for possible solutions.[0m

我搜索了这个问题的答案但我找不到它。决议似乎是为了完成以下内容:

I have searched for the answer to this but I cannot find it. The resolution appears to be to complete the following:

export LC_ALL="en_US.UTF-8"

我不知道如何完成此操作?我在终端中运行了这个,然后当我输出语言环境时,我看到以下内容:

I am not sure how to complete this? I have run this in terminal and then when I output the locale I see the following:

LANG="en_GB.UTF-8"
LC_COLLATE="en_GB.UTF-8"
LC_CTYPE="en_GB.UTF-8"
LC_MESSAGES="en_GB.UTF-8"
LC_MONETARY="en_GB.UTF-8"
LC_NUMERIC="en_GB.UTF-8"
LC_TIME="en_GB.UTF-8"
LC_ALL="en_GB.UTF-8"

但是,当我退出/重新打开终端时,LC_ALL再次为空。在这之后有什么我应该跑的吗?

However, when I quit/reopen Terminal the LC_ALL is blank again. Is there something I should run after this?

编辑 - 我看过这个链接 http://perlgeek.de/en/article/set-up-a-clean-utf8-environment 但仍然无法完成区域设置的安装,不确定如何。

EDIT - I have seen this link http://perlgeek.de/en/article/set-up-a-clean-utf8-environment but still unable to complete the install of the locale, not sure how.

推荐答案

所以有两种方法可以解决这个问题,这在这里有两种类型的答案。

So there's two ways to approach this, which is reflected in the two types of answers here.

一种是通过更改shell配置(例如.bashrc或locale默认值)对您的环境进行永久性更改。因此,在另一台机器上运行此应用程序将遇到类似的错误。

One is to make a permanent change to your environment by changing your shell configuration (e.g. .bashrc or locale defaults). So running this app on another machine will run into similar errors.

另一种方法是将此设置更改为应用程序构建过程的一部分,因此它将在任何计算机上成功运行 - 但每次创建新应用程序时使用Cocoapods插件,你需要添加这个脚本。

The other way is to change this setting as part of the build process of your app, so it will run successfully on any machine - but every time you create a new app using the Cocoapods plugin you'll need to add this script.

我的选择是后者,所以这里是如何做到的:

My preference is for the latter, so here's how to do that:

编辑您当前的构建方案 - cmd-option-R

Edit your current build scheme - cmd-option-R

展开 Build ,然后选择预行动

添加新运行脚本操作

然后为您的脚本添加:

export LC_ALL="en_US.UTF-8"

这对我有用。它看起来应该是这样的:

This worked for me. It should look something like this:

这篇关于为CocoaPods插件设置Xcode的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆