2012年2月20日月曜日

pythonbrewのインストールに少しつまずいた話

pythonbrewをCentOSにインストールしようとした時の話

[root@host ~]# ./pythonbrew-install
Can not get stable-version of pythonbrew.

インストールできない..
そこで、pythonbrew-installの中身を確認

82 STABLE_VERSION=`curl -skL https://github.com/utahta/pythonbrew/raw/master/stable-version.txt`
83 STABLE_VERSION=`trim $STABLE_VERSION`

ここでうまくSTABLE_VERSIONが取れてないのかと思い、シンプルに実行

[root@host ~]# echo `curl -skL https://github.com/utahta/pythonbrew/raw/master/stable-version.txt`

[root@host ~]# 

という訳でやはりstable-version.txtをそもそも取得できていないことが判明。
-sオプションを外して実行

[root@host ~]# curl -kL https://github.com/utahta/pythonbrew/raw/master/stable-version.txtcurl: (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に--insecureオプションを付けてテスト

[root@host ~]# curl --insecure -kL https://github.com/utahta/pythonbrew/raw/master/stable-version.txt1.1
1.1

取れた! ということでpythonbrew-installを変更して実行

[root@host ~]# ./pythonbrew-install
Downloading http://pypi.python.org/packages/source/p/pythonbrew/pythonbrew-1.1.tar.gz
######################################################################## 100.0%
Extracting /usr/local/pythonbrew/dists/pythonbrew-1.1.tar.gz
Installing pythonbrew into /usr/local/pythonbrew

Well-done! Congratulations!

The pythonbrew is installed as:
   
  /usr/local/pythonbrew

After that, exit this shell, start a new one, and install some fresh
pythons:

  pythonbrew install 2.7.2
  pythonbrew install 3.2

For further instructions, run:

  pythonbrew help

The default help messages will popup and tell you what to do!

Enjoy pythonbrew at /usr/local/pythonbrew!!

うまくインストールできた。

おまけ
[root@host ~]# diff pythonbrew-install pythonbrew-install.org 
82c82
< STABLE_VERSION=`curl --insecure -skL https://github.com/utahta/pythonbrew/raw/master/stable-version.txt`
---
> STABLE_VERSION=`curl -skL https://github.com/utahta/pythonbrew/raw/master/stable-version.txt`

0 件のコメント:

コメントを投稿