新增:《解决 DotNET 安装完,报错:Couldn't find a valid ICU package installed on the system. Please install libicu using your package manager and try again》(侧边栏文章标题增加序号显示)
This commit is contained in:
@@ -98,6 +98,9 @@ function getItemsByDate (path: string) {
|
||||
// 将最近年份分组展开
|
||||
yearGroups[0].collapsed = false
|
||||
}
|
||||
|
||||
// 添加序号
|
||||
addOrderNumber(yearGroups)
|
||||
return yearGroups
|
||||
}
|
||||
|
||||
@@ -152,5 +155,22 @@ function getItems (path: string) {
|
||||
// 4.清空侧边栏分组下标题数组
|
||||
items = []
|
||||
})
|
||||
|
||||
// 添加序号
|
||||
addOrderNumber(groups)
|
||||
return groups
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加序号
|
||||
*
|
||||
* @param groups 分组数据
|
||||
*/
|
||||
function addOrderNumber(groups) {
|
||||
for (var i = 0; i < groups.length; i++) {
|
||||
for (var j = 0; j < groups[i].items.length; j++) {
|
||||
var items = groups[i].items
|
||||
items[j].text = `[${j + 1}] ${items[j].text}`
|
||||
}
|
||||
}
|
||||
}
|
@@ -29,7 +29,7 @@ docker logs prometheus
|
||||
|
||||
错误信息部分也很突出,level=error。
|
||||
|
||||
```
|
||||
```shell
|
||||
caller=query_logger.go:90 level=error component=activeQueryTracker msg="Error opening quer log file" file=/opt/bitnami/prometheus/data/queries.active err="open data/queries.active: permission denied"
|
||||
panic: Unable to create mmap-ed active query log
|
||||
```
|
||||
@@ -40,9 +40,7 @@ panic: Unable to create mmap-ed active query log
|
||||
|
||||
简单翻译一下错误信息 msg 及后面部分提示。
|
||||
|
||||
```
|
||||
信息:打开查询日志文件时出错 file=/opt/bitnami/prometheus/data/queries.active 错误:打开 data/queries.active:拒绝访问
|
||||
```
|
||||
> 信息:打开查询日志文件时出错 file=/opt/bitnami/prometheus/data/queries.active 错误:打开 data/queries.active:拒绝访问
|
||||
|
||||
其中的关键信息是 `permission denied`(拒绝访问),从这字面意思上可以得知和权限有关。
|
||||
|
||||
|
70
docs/categories/issues/2022/11/06/解决DotNET安装后报错的问题.md
Normal file
70
docs/categories/issues/2022/11/06/解决DotNET安装后报错的问题.md
Normal file
@@ -0,0 +1,70 @@
|
||||
---
|
||||
title: 解决 DotNET 安装完,报错:Couldn't find a valid ICU package installed on the system. Please install libicu using your package manager and try again
|
||||
author: 查尔斯
|
||||
date: 2022/11/06 15:35
|
||||
categories:
|
||||
- Bug万象集
|
||||
tags:
|
||||
- DotNET
|
||||
- Linux
|
||||
- CentOS
|
||||
---
|
||||
|
||||
# 解决 DotNET 安装完,报错:Couldn't find a valid ICU package installed on the system. Please install libicu using your package manager and try again
|
||||
|
||||
## 问题描述
|
||||
|
||||
**C:** 今天,笔者在一台 CentOS 7.9 服务器上手动安装完 DotNET 6.0.401 并配置好了环境变量之后,照例想查看一下是否安装成功。
|
||||
|
||||
```shell
|
||||
dotnet --version
|
||||
```
|
||||
|
||||
预想的版本信息没输出,倒是输出了这么一段错误。
|
||||
|
||||

|
||||
|
||||
```c#
|
||||
Process terminated. Couldn't find a valid ICU package installed on the system. Please install libicu using your package manager and try again. Alternatively you can set the configuration flag System.Globalization.Invariant to true if you want to run with no globalization support. Please see https://aka.ms/dotnet-missing-libicu for more information.
|
||||
at System.Environment.FailFast(System.String)
|
||||
at System.Globalization.GlobalizationMode+Settings..cctor()
|
||||
at System.Globalization.CultureData.CreateCultureWithInvariantData()
|
||||
at System.Globalization.CultureData.get_Invariant()
|
||||
at System.Globalization.CultureInfo..cctor()
|
||||
at System.Globalization.CultureInfo.get_CurrentUICulture()
|
||||
at System.TimeZoneInfo.GetUtcStandardDisplayName()
|
||||
at System.TimeZoneInfo.CreateUtcTimeZone()
|
||||
at System.TimeZoneInfo..cctor()
|
||||
at System.DateTime.get_Now()
|
||||
at Microsoft.DotNet.Cli.Program.Main(System.String[])
|
||||
Aborted
|
||||
```
|
||||
|
||||
<!-- more -->
|
||||
|
||||
## 原因分析
|
||||
|
||||
简单翻译一下关键错误信息。
|
||||
|
||||
> 进程终止。找不到系统上安装的有效 ICU 包。请使用包管理器安装 libicu,然后重试。或者,如果您想在不支持全球化的情况下运行,可以将配置标志 System.Globalization.Invariant 设置为 true。请访问 https://aka.ms/dotnet-missing-libicu 了解更多信息。
|
||||
|
||||
从提示信息来看,问题的原因是当前系统没有安装 DotNet 需要的 `libicu` 库。
|
||||
|
||||
## 解决方案
|
||||
|
||||
实际上这也是因为笔者采用的手动安装方式才导致的问题,如果采用包管理器(在线)安装方式,这个 `libicu` 库会自动被安装好,也就不会出现这个问题了。
|
||||
|
||||

|
||||
|
||||
知道了问题的原因,那就安装一下这个依赖库。
|
||||
|
||||
```shell
|
||||
yum -y install libicu
|
||||
```
|
||||
|
||||
安装完后,再执行查看版本命令,版本信息正常输出了。
|
||||
|
||||
## 参考资料
|
||||
|
||||
1. 在 CentOS 上安装 .NET SDK 或 .NET 运行时:https://learn.microsoft.com/zh-cn/dotnet/core/install/linux-centos
|
||||
2. 用于全球化的运行时配置选项:https://learn.microsoft.com/zh-cn/dotnet/core/runtime-config/globalization
|
BIN
docs/public/img/2022/11/06/202211061520256.png
Normal file
BIN
docs/public/img/2022/11/06/202211061520256.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 45 KiB |
BIN
docs/public/img/2022/11/06/202211061523521.png
Normal file
BIN
docs/public/img/2022/11/06/202211061523521.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 128 KiB |
1
docs/public/img/svg/number/1.svg
Normal file
1
docs/public/img/svg/number/1.svg
Normal file
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1668342317170" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2197" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M117.248 121.344L59.392 67.072 128 0h220.16L214.528 121.344h-97.28zM197.632 568.32l65.024-56.32 56.832 56.32-35.328 395.264-66.56 60.416-55.296-60.928 35.328-394.752z m37.376-423.936L367.104 24.576l-37.376 422.4L262.656 512 208.384 446.464l26.624-302.08z" p-id="2198"></path></svg>
|
After Width: | Height: | Size: 614 B |
1
docs/public/img/svg/number/2.svg
Normal file
1
docs/public/img/svg/number/2.svg
Normal file
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1668342330798" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2338" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M309.936 885.784L177.5 1004.04l32.483-365.365c0.77-9.209 1.502-18.457 3.891-26.125 2.428-7.667 4.933-13.794 9.133-18.457 0 0 8.554-7.668 22.657-21.5L286.7 532.71l50.747 53.714-27.512 299.36zM656.65 901.16l56.065 61.42L645.939 1024h-451.37l138.178-122.841h323.904z m33.985-348.488c-16.954 16.877-30.363 21.501-65.659 21.501H360.953l-55.91-59.88 43.695-44.504c5.626-6.127 12.87-10.75 20.268-13.833 7.398-3.045 13.41-4.586 21.077-4.586h290.188l55.872 59.918-45.507 41.384z m-307.758-429.83l-55.91-59.917L392.047 0H705.24c30.672 0 45.199 7.668 62.269 27.628l20.576 24.583-78.26 70.63H382.879z m342.553 19.922l79.762-70.63 27.243 30.71c3.352 3.083 7.09 10.75 11.097 21.501 1.927 4.624 2.35 9.248 2.736 13.833 0.54 6.127-0.038 16.878-0.385 30.71l-21.578 227.188c-2.197 27.666-7.36 38.417-27.127 58.338l-42.579 39.92-55.756-58.338 26.587-293.232z" p-id="2339"></path></svg>
|
After Width: | Height: | Size: 1.2 KiB |
Reference in New Issue
Block a user