ios - Unicode 规范化不适用于 ASCII-8BIT
问题描述
13: from /usr/local/bin/pod:23:in `<main>'
12: from /usr/local/bin/pod:23:in `load'
11: from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.0.beta.2/bin/pod:55:in `<top (required)>'
10: from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.0.beta.2/lib/cocoapods/command.rb:52:in `run'
9: from /Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:324:in `run'
8: from /Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:337:in `rescue in run'
7: from /Library/Ruby/Gems/2.6.0/gems/claide-1.0.3/lib/claide/command.rb:396:in `handle_exception'
6: from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.0.beta.2/lib/cocoapods/command.rb:66:in `report_error'
5: from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.0.beta.2/lib/cocoapods/user_interface/error_report.rb:30:in `report'
4: from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.0.beta.2/lib/cocoapods/user_interface/error_report.rb:105:in `markdown_podfile'
3: from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.0.beta.2/lib/cocoapods/config.rb:226:in `podfile_path'
2: from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.0.beta.2/lib/cocoapods/config.rb:166:in `installation_root'
1: from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.0.beta.2/lib/cocoapods/config.rb:166:in `unicode_normalize'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/unicode_normalize/normalize.rb:141:in `normalize': Unicode Normalization not appropriate for ASCII-8BIT (Encoding::CompatibilityError)
我面临这些错误,不知道为什么当我运行 pod update 时它会给我这个错误。有什么解决办法??
解决方案
这个问题出现在 Cocoapods 1.11.0 中,许多人已经注意到回滚到 1.10.2 解决了这个问题。但最初的问题来自终端中设置的错误区域设置。它必须是基于 UTF-8 的语言环境。
您可以在终端中运行“语言环境”来检查当前的语言环境设置。它应该是这样的:
LANG="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_CTYPE="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_ALL=
If you have ascii-based locales set or "C" (which is also an ascii locale) then run
export LC_ALL=en_US.UTF-8
If you prefer some other locale (not en_US) then run locale -a
to see the list of available options and pick UTF-8 locale you prefer.
Actually CocoaPods warns that UTF-8 locale is required:
WARNING: CocoaPods requires your terminal to be using UTF-8 encoding.
Consider adding the following to ~/.profile:
export LANG=en_US.UTF-8
But before 1.11.0 it was required only in case you use pods which contain non-ascii symbols in their names (Chinese for example) but starting 1.11.0 it become more strict. There is a discussion on Cocoapods GitHub about it: https://github.com/CocoaPods/CocoaPods/issues/10939
推荐阅读
- python - 使用 K 折交叉验证计算 R2 分数和 RMSE
- php - 检索与 Stripe 一起使用的促销代码
- css - 引导程序仅导入网格错误?
- c - C:带有 void 指针的可变参数函数
- web-scraping - 搜索引擎如何在不被阻止的情况下抓取网站?
- javascript - 如何将两个特定对象值转换为元组项数组?
- python - Firebase RealTime db 使用 python ,如何检查用户名是否存在
- python - 如何使用 Beautifulsoup 获取跨度标题
- docker - Helm 无法从本地 repo 中提取图像
- php - 使用 PHP 从 HTML Excel 文件导入数据