【问题标题】:how to fix the locale when input gitlab-ctl reconfigure输入 gitlab-ctl reconfigure 时如何修复语言环境
【发布时间】:2021-06-17 09:12:50
【问题描述】:

当我输入gitlab-ctl reconfigure时,它显示:

gitlab-ctl reconfigure it shows DETAIL:  
The database was initialized with LC_COLLATE "zh_CN.UTF-8",  
which is not recognized by setlocale().

系统是centos7:怎么解决这个问题?

.bashrc 的内容

# User specific aliases and functions

alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'

# Source global definitions
if [ -f /etc/bashrc ]; then
        . /etc/bashrc
fi

以及个人资料的内容

unset i
unset -f pathmunge
export PKG_CONFIG_PATH=/usr/local/lib64/pkgconfig:$PKG_CONFIG_PATH
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib64
export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.252.b09-2.el7_8.x86_64/jre/bin/java
export JRE_HOME=$JAVA_HOME/jre
export CLASSPATH=$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATH
export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH
export M2_HOME=/usr/local/maven3
export PATH=$PATH:$JAVA_HOME/bin:$M2_HOME/bin
export PATH=$PATH:/usr/local/gcc-linaro-4.9-2016.02-x86_64_arm-linux-gnueabihf/bin
export PATH=$PATH:/usr/local/mysql/bin

我也试过安装postgresql,登录后显示如下。

[root@0c-5b-8f-27-9a-64 ~]# su - postgres
Last login: Tue Jun 22 14:30:01 CST 2021 on pts/0
-bash: warning: setlocale: LC_ALL: cannot change locale (zh_CN.UTF-8): Permission denied
-bash: warning: setlocale: LC_ALL: cannot change locale (zh_CN.UTF-8)
-bash: warning: setlocale: LC_ALL: cannot change locale (zh_CN.UTF-8)
-bash: export: `=': not a valid identifier
-bash: export: `en_US.UTF-8': not a valid identifier
/bin/sh: warning: setlocale: LC_ALL: cannot change locale (zh_CN.UTF-8)
-bash: warning: setlocale: LC_ALL: cannot change locale (zh_CN.UTF-8)
-bash: export: `=': not a valid identifier
-bash: export: `en_US.UTF-8': not a valid identifier

【问题讨论】:

标签: gitlab locale


【解决方案1】:

检查是否可以像this thread 那样重新生成正确的语言环境

在你的情况下,in here:

localedef -i zh_CN -c -f UTF-8 zh_CN.UTF-8
export LANG=zh_CN.UTF-8
gitlab-ctl reconfigure

并将/etc/locale.conf 更改为:

LANG=zh_CN.UTF-8
LC_COLLATE=zh_CN.UTF-8

然后看看问题是否仍然存在。

【讨论】:

  • 我尝试了三行命令,但问题仍然存在。
  • 当我运行gitlab-rake gitlab:backup:create 时,它也显示了同样的问题。有没有其他方法可以备份我的 gitlab 数据?
  • @ylliu 不是真的,除了在docs.gitlab.com/ee/user/project/issues 中开票。您是否先尝试修改/etc/locale.conf? (我已经编辑了答案以添加该步骤)
  • 还是不行。而且还有一个奇怪的问题。当我登录时。它显示 -bash: export: =': not a valid identifier` 和 -bash: export: en_US.UTF-8': not a valid identifier. I have already set etc/locale.conf to zh_CN.UTF-8, but when I relogin, it changed to en_US.UTF-8. I have to reset etc/locale.conf and I also need to set LC_ALL=zh_CN.utf-8. I also tried to set /etc/locale LANG=zh_CN.UTF-8`,但它仍然不起作用.
  • 你能用你家 .bashrc 和 .profile 的内容编辑你的问题吗?
猜你喜欢
  • 2019-05-04
  • 2017-03-10
  • 1970-01-01
  • 2019-12-26
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2020-09-10
  • 2019-09-05
相关资源
最近更新 更多