diff --git a/docs/.vitepress/config/sidebar.ts b/docs/.vitepress/config/sidebar.ts index 7c4f6bf03..2f7337f2d 100644 --- a/docs/.vitepress/config/sidebar.ts +++ b/docs/.vitepress/config/sidebar.ts @@ -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}` + } + } } \ No newline at end of file diff --git a/docs/categories/issues/2022/11/04/解决Docker安装Prometheus启动报错的问题.md b/docs/categories/issues/2022/11/04/解决Docker安装Prometheus启动报错的问题.md index 3cf43e25c..c0c6daf1a 100644 --- a/docs/categories/issues/2022/11/04/解决Docker安装Prometheus启动报错的问题.md +++ b/docs/categories/issues/2022/11/04/解决Docker安装Prometheus启动报错的问题.md @@ -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`(拒绝访问),从这字面意思上可以得知和权限有关。 diff --git a/docs/categories/issues/2022/11/06/解决DotNET安装后报错的问题.md b/docs/categories/issues/2022/11/06/解决DotNET安装后报错的问题.md new file mode 100644 index 000000000..e2687d247 --- /dev/null +++ b/docs/categories/issues/2022/11/06/解决DotNET安装后报错的问题.md @@ -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 +``` + +预想的版本信息没输出,倒是输出了这么一段错误。 + +![202211061520256](../../../../../public/img/2022/11/06/202211061520256.png) + +```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 +``` + + + +## 原因分析 + +简单翻译一下关键错误信息。 + +> 进程终止。找不到系统上安装的有效 ICU 包。请使用包管理器安装 libicu,然后重试。或者,如果您想在不支持全球化的情况下运行,可以将配置标志 System.Globalization.Invariant 设置为 true。请访问 https://aka.ms/dotnet-missing-libicu 了解更多信息。 + +从提示信息来看,问题的原因是当前系统没有安装 DotNet 需要的 `libicu` 库。 + +## 解决方案 + +实际上这也是因为笔者采用的手动安装方式才导致的问题,如果采用包管理器(在线)安装方式,这个 `libicu` 库会自动被安装好,也就不会出现这个问题了。 + +![202211061523521](../../../../../public/img/2022/11/06/202211061523521.png) + +知道了问题的原因,那就安装一下这个依赖库。 + +```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 diff --git a/docs/public/img/2022/11/06/202211061520256.png b/docs/public/img/2022/11/06/202211061520256.png new file mode 100644 index 000000000..db7a88332 Binary files /dev/null and b/docs/public/img/2022/11/06/202211061520256.png differ diff --git a/docs/public/img/2022/11/06/202211061523521.png b/docs/public/img/2022/11/06/202211061523521.png new file mode 100644 index 000000000..b83c2dcd0 Binary files /dev/null and b/docs/public/img/2022/11/06/202211061523521.png differ diff --git a/docs/public/img/svg/number/1.svg b/docs/public/img/svg/number/1.svg new file mode 100644 index 000000000..64506b5be --- /dev/null +++ b/docs/public/img/svg/number/1.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/docs/public/img/svg/number/2.svg b/docs/public/img/svg/number/2.svg new file mode 100644 index 000000000..7fb58ee82 --- /dev/null +++ b/docs/public/img/svg/number/2.svg @@ -0,0 +1 @@ + \ No newline at end of file