Skip to content

Instantly share code, notes, and snippets.

@dchentech
Created November 26, 2012 07:21
Show Gist options
  • Save dchentech/4147008 to your computer and use it in GitHub Desktop.
Save dchentech/4147008 to your computer and use it in GitHub Desktop.
CentOS安装Pygments.rb
系统默认的Python是2.4.3, 使用时报MentosError: Failed to get header错误。
看了下官方文档, pygments.rb需要2.5以上, 因此选择了和ruby的rvm类似的可以管理多版本python的https://github.com/utahta/pythonbrew。
运行默认推荐的 curl -kL http://xrl.us/pythonbrewinstall | bash , 终端提示如下错误:
$ CURLOPT_SSL_VERIFYPEER=false curl -kL http://xrl.us/pythonbrewinstall | bash
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 229 100 229 0 0 299 0 --:--:-- --:--:-- --:--:-- 0
curl: (60) SSL certificate problem, verify that the CA cert is OK. Details:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
More details here: http://curl.haxx.se/docs/sslcerts.html
curl performs SSL certificate verification by default, using a "bundle"
of Certificate Authority (CA) public keys (CA certs). The default
bundle is named curl-ca-bundle.crt; you can specify an alternate file
using the --cacert option.
If this HTTPS server uses a certificate signed by a CA represented in
the bundle, the certificate verification probably failed due to a
problem with the certificate (it might be expired, or the name might
not match the domain name in the URL).
If you'd like to turn off curl's verification of the certificate, use
the -k (or --insecure) option.
这里面嵌套了两层curl, 之前记得用在stackoverflow环境变量可以解决curl认证问题, 结果找不到了, 于是采用下面手工安装的方式。
1, 下载源码
git clone git://github.com/utahta/pythonbrew.git && cd pythonbrew
2, 安装
python pythonbrew_install.py
3, 添加到 ~/.bashrc
[[ -s "$HOME/.pythonbrew/etc/bashrc" ]] && source "$HOME/.pythonbrew/etc/bashrc"
4, 安装2.7.2版本的python并切换
pythonbrew install 2.7.2
pythonbrew switch 2.7.2
5, 安装Pygments语法高亮库
pip install Pygments
6, 没了~
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment