LoginSignup
6
7

More than 5 years have passed since last update.

grip環境構築onCentOS6.5

Posted at

gripは"git hub like mark down renderer service"。
手元のgithub準拠のmarkdown文書を清書表示してくれるWebサービスを立ち上げちゃうのだ。joeyespoさんありがとう。
https://github.com/joeyespo/grip
現在の最新版はversion 2.0.0らしい
インストールの方法や使い方はさすがREADME driven developmentらしく、上記URLのREADME.mdで尽くされてる感じです。だから、pipが使える人はそちらへどうぞ。
自分はCentOSを使っていて、pipがそもそも無いよ、というケースだったのでそのところだけフォローしました。

Python環境構築 on CentOS6.5

いきなりpipは使えないので。
root権限でやるべきか微妙だけれど自分はroot権限で実施してみた。一般ユーザーでこれでいけるかな。

wget https://bootstrap.pypa.io/ez_setup.py -O - | python
easy_install pip

gripのインストールとREADME.mdのブラウジング

インストールはこれだけ、root権限でやるべきじゃなかったっぽい。

sudo pip install grip

起動。

grip 3000

こうすると、127.0.0.1:3000が開くので、sshでport forwardingして使うのがセキュアである。

sudo ssh -L80:127.0.0.1:3000 user@server

こうしておいてhttp://localhost/README.mdとかいうURLをアクセスすると、サーバー上のREADME.mdがレンダリングされるというわけ。

troubles as of 2014May(version 2.0.0)

設定ファイルの改行コードがWindows版

最新版なのに、いきなりこんなの踏んだ
https://github.com/joeyespo/grip/issues/36

Seemed to be fixed by manually removing Windows line endings from the file.だって。
以下のように\rを削除した。

cp /usr/lib/python2.6/site-packages/grip/settings.py backup.txt 
tr --delete '\r' < backup.txt > /usr/lib/python2.6/site-packages/grip/settings.py

キャッシュファイルを勝手に作る

おそらく、こういうのはroot権限でインストールするなってことなんだと思う。

OSError: [Errno 13] Permission denied: '/usr/var'

しょうがないのでroot権限濫用。

sudo mkdir /usr/var
sudo chmod 777 /usr/var
6
7
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
7