访问tracd服务器时出现以下错误,发生了什么?
感谢。
[oke@localhost Trac-0.11.7]$ sudo tracd -p 8000 /home/deddihp/trac/ Server starting in PID 5082. Serving on 0.0.0.0:8000 view at http://127.0.0.1:8000/ ---------------------------------------- Exception happened during processing of request from ('127.0.0.1', 47804) Traceback (most recent call last): File "/usr/lib/python2.6/SocketServer.py", line 558, in process_request_thread self.finish_request(request, client_address) File "/usr/lib/python2.6/SocketServer.py", line 320, in finish_request self.RequestHandlerClass(request, client_address, self) File "/usr/lib/python2.6/SocketServer.py", line 615, in __init__ self.handle() File "/usr/lib/python2.6/BaseHTTPServer.py", line 329, in handle self.handle_one_request() File "/usr/lib/python2.6/site-packages/Trac-0.11.7-py2.6.egg/trac/web/wsgi.py", line 194, in handle_one_request gateway.run(self.server.application) File "/usr/lib/python2.6/site-packages/Trac-0.11.7-py2.6.egg/trac/web/wsgi.py", line 94, in run response = application(self.environ, self._start_response) File "/usr/lib/python2.6/site-packages/Trac-0.11.7-py2.6.egg/trac/web/standalone.py", line 100, in __call__ return self.application(environ, start_response) File "/usr/lib/python2.6/site-packages/Trac-0.11.7-py2.6.egg/trac/web/main.py", line 346, in dispatch_request locale.setlocale(locale.LC_ALL, environ['trac.locale']) File "/usr/lib/python2.6/locale.py", line 513, in setlocale return _setlocale(category, locale) Error: unsupported locale setting ----------------------------------------
答案 0 :(得分:4)
您必须安装缺少的区域设置。检查命令“locale”以查看无法设置的环境变量。
[calvin@hobbes:~]$ locale
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=en_US.UTF-8
LANGUAGE=en_US:en
LC_CTYPE="en_US"
LC_NUMERIC="en_US"
LC_TIME="en_US"
LC_COLLATE="en_US"
LC_MONETARY="en_US"
LC_MESSAGES="en_US"
LC_PAPER="en_US"
LC_NAME="en_US"
LC_ADDRESS="en_US"
LC_TELEPHONE="en_US"
LC_MEASUREMENT="en_US"
LC_IDENTIFICATION="en_US"
LC_ALL=en_US
然后使用命令“locale-gen”安装缺少的“en_US”语言环境:
[calvin@hobbes:~]$ sudo locale-gen en_US
Generating locales (this might take a while)...
en_US.UTF-8... done
Generation complete.
最后,使用命令“dpkg-reconfigure”重新配置所有可用的语言环境:
[calvin@hobbes:~]$ sudo dpkg-reconfigure locales
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = "en_US:en",
LC_ALL = "en_US",
LANG = "en_US.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
/usr/bin/locale: Cannot set LC_CTYPE to default locale: No such file or directory
/usr/bin/locale: Cannot set LC_MESSAGES to default locale: No such file or directory
/usr/bin/locale: Cannot set LC_ALL to default locale: No such file or directory
Generating locales (this might take a while)...
en_GB.ISO-8859-1... done
en_GB.ISO-8859-15... done
en_GB.UTF-8... done
en_US.ISO-8859-1... done
en_US.ISO-8859-15... done
en_US.UTF-8... done
pt_PT.ISO-8859-1... done
pt_PT.UTF-8... done
pt_PT.ISO-8859-15@euro... done
Generation complete.
然后您可以在“locale”命令输出中看到不再有错误:
[calvin@hobbes:~]$ locale
LANG=en_US.UTF-8
LANGUAGE=en_US:en
LC_CTYPE="en_US"
LC_NUMERIC="en_US"
LC_TIME="en_US"
LC_COLLATE="en_US"
LC_MONETARY="en_US"
LC_MESSAGES="en_US"
LC_PAPER="en_US"
LC_NAME="en_US"
LC_ADDRESS="en_US"
LC_TELEPHONE="en_US"
LC_MEASUREMENT="en_US"
LC_IDENTIFICATION="en_US"
LC_ALL=en_US
重新启动你的tracd服务器,你应该没问题。
此致
答案 1 :(得分:3)
看起来您尝试使用不受支持的语言环境运行tracd,尝试在启动trac守护程序之前将其设置为所需的语言环境(en_US?)。
LC_ALL=en_US sudo tracd -p 8000 /home/deddihp/trac/
答案 2 :(得分:0)
卸载Apache2后我遇到了同样的问题(我想使用Trac的独立服务器)。我只需重新安装语言包即可解决问题:
sudo apt-get install --reinstall language-pack-en
答案 3 :(得分:0)
与"错误:不支持的区域设置"有相同的问题 与一些trac(s)我一段时间没有使用。 通过设置区域设置解决,更新到最新版本
基本上:
dpkg-reconfigure locales
或手动设置,因为Miguel Rentes在早些时候的回答中写道。就我而言de_DE.UTF8
然后使用以下命令更新easyinstall和trac:
wget http://bootstrap.pypa.io/ez_setup.py -O - | python
得到:"证书错误"
wget --no-check-certificate http://bootstrap.pypa.io/ez_setup.py -O - | python
然后
easy_install http://svn.edgewall.org/repos/trac/branches/0.12-stable
答案 4 :(得分:0)
在CentOS上,同样的问题通过比较解决了
/etc/sysconfig/i18n
到locale -a
我修改了/etc/sysconfig/i18n
并将UTF-8
更改为utf8
,因为这是一个有效的区域设置。
然后所有症状都消失了。