全局初始化失败:BadValue无效或未设置用户区域设置.请确保正确设置LANG和/或LC_ *环境变量 [英] Failed global initialization: BadValue Invalid or no user locale set. Please ensure LANG and/or LC_* environment variables are set correctly

查看:717
本文介绍了全局初始化失败:BadValue无效或未设置用户区域设置.请确保正确设置LANG和/或LC_ *环境变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很难在服务式的Herbert和Homer上生成语言环境. 我运行mongo收到警告

I have a problem to generate the locales on the serveur herbert and homer . I run mongo I get the warning

Failed global initialization: BadValue Invalid or no user locale set. Please ensure LANG and/or LC_* environment variables are set correctly.

我跑步时

dpkg-reconfigure locales

mongo启动成功,然后重新启动服务器并运行mongo时,我也遇到了同样的问题.

mongo start successful , then When reboot the server and run mongo i have the same problem.

感谢帮助

推荐答案

https ://askubuntu.com/questions/536875/error-in-installing-mongo-in-virtual-machine :

好像您的语言环境设置在该VM上损坏或不存在, 或至少在该VM上的该会话. MongoDB的依赖项之一 如果未正确设置区域设置,则(boost)将失败(请参见 SERVER-9032).供参考,在SERVER-9032中进行更改之前 问题仍然发生,但看起来像这样.

Looks like your locale settings are broken or non-existent on that VM, or at least that session on that VM. One of MongoDB's dependencies (boost) will fail when a locale is not correctly set (see SERVER-9032). For reference, before the change in SERVER-9032 this problem still happened but looked like this.

有时注销并重新登录可以解决此问题(仅在当前情况下无效) 会话),或者您可以尝试运行sudo local-gen以确保 一代成功了.

Sometimes logging out and back in can fix it (only broken for current session), or you can try running sudo local-gen to make sure generation is successful.

在此期间,作为获取mongo(或mongod等)的替代方法 运行时,只需在开始运行之前手动设置LC_ALL变量 程序:

In the meantime, as a workaround to get mongo (or mongod etc.) running, just set your LC_ALL variable manually before starting the program:

export LC_ALL=C
mongo 

这篇关于全局初始化失败:BadValue无效或未设置用户区域设置.请确保正确设置LANG和/或LC_ *环境变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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