- 追加された行はこの色です。
- 削除された行はこの色です。
&tag(Stringer);
*目次 [#d18b0078]
#contents
*関連ページ [#e86e154e]
*参考情報 [#c8f20019]
-[[swanson/stringer:https://github.com/swanson/stringer]]
*OS Xにインストール [#c757a2da]
**参考情報 [#xba54636]
-[[stringer/docs/VPS.md at master · swanson/stringer:https://github.com/swanson/stringer/blob/master/docs/VPS.md]]にあるLinuxのインストールを参考に。
**事前準備 [#yc564ec4]
***Postgresqlのインストール [#pb6fabad]
***PostgreSQLのインストール [#pb6fabad]
-[[MacPorts/postgresql]]を参考にしてインストール。
***データベースユーザーとデータベースの生成 [#z12e018b]
-データベースユーザーの作成。パスワードの入力が求められるので適当に決める。
sudo -u postgres createuser -D -A -P stringer
-データベースの生成
sudo -u postgres createdb -O stringer stringer_live
***ユーザーの生成 [#xc517977]
-とりあえずパス
***Rubyのインストール [#i0be873b]
-rbenvで、Ruby 2.0.0以上をインストールしておく。
**Stringerのセットアップ [#e494328c]
***本体の準備 [#lcdd1b94]
-git cloneして、bundle installする
#pre{{
git clone https://github.com/swanson/stringer.git
cd stringer
bundle install
rbenv rehash
}}
***環境変数の設定 [#e07b7819]
-直接設定ファイルに書き込んでも良い。
#pre{{
echo 'export STRINGER_DATABASE="stringer_live"' >> $HOME/.bash_profile
echo 'export STRINGER_DATABASE_USERNAME="stringer"' >> $HOME/.bash_profile
echo 'export STRINGER_DATABASE_PASSWORD="EDIT_ME"' >> $HOME/.bash_profile
echo 'export RACK_ENV="production"' >> $HOME/.bash_profile
source ~/.bash_profile
}}
***マイグレーション [#jbca8c84]
-テーブルを生成する
#pre{{
cd $HOME/stringer
rake db:migrate RACK_ENV=production
}}
**サーバー起動 [#i346cc41]
-以下のコマンドで実行
bundle exec foreman start
**フィード取得 [#rd7f2dd6]
-crontabなどに登録して実行。とりあえず手動でもOK。
bundle exec rake fetch_feeds
*トラブルシューティング [#he88ec65]
**foremanを起動してアクセスすると「Internal Server Error」 [#y6b505f8]
-プロンプトには 「pry(main)>」と表示される。
-とりあえずCTRL-Dで次に進んだ。
*解析 [#gffbf603]
**キーボード処理 [#yd6fd14e]
-stries.js.erbで処理されている。