- PostgreSQL >= 9.3
- Elasticsearch >= 1.7
- InfluxDB >= 0.9
- Redis >= 3.0
- Ruby >= 2.0
- Node.js >= 5.3
- 安裝 Elasticsearch
brew install homebrew/versions/elasticsearch17
並啟動之. 如果已安裝其他版本請先移除brew uninstall --force elasticsearch
- 複製
config/application.yml.ci
,config/database.yml.ci
,paypal.yml.ci
成沒有 .ci 結尾的檔名 - 修改
config/database.yml
成你習慣的樣子 npm install
bundle install
pre-commit install
rake db:create db:migrate db:test:clone db:seed_fu
echo 3000 > ~/.pow/commandp
- 使用
foreman start
啟動 sidekiq, rails server 與 webpack dev server - 這樣應該就可以上 http://commandp.dev 了
目前 ApiV2 與 ApiV3 的的 API 文件是採用 apidocs 的格式, 舊文件請至 {WIKI} 頁查詢。
brew install nvm
nvm install
npm install apidoc -g
於 repo 下執行 ./bin/commandp_docs
將會產生文檔於 doc/
下
- ApiV2:
open doc/apiv2doc/index.html
- ApiV3:
open doc/apiv3doc/index.html
brew install elasticsearch
ln -sfv /usr/local/opt/elasticsearch/*.plist ~/Library/LaunchAgents
(start) launchctl load ~/Library/LaunchAgents/homebrew.mxcl.elasticsearch.plist
(stop) launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.elasticsearch.plist
plugin -install mobz/elasticsearch-head #Elasticsearch Web 瀏覽介面
在開啟瀏覽器 http://localhost:9200/_plugin/head/
目前有使用到的 Model:User
, Work
Work.initialize_elasticsearch
User.initialize_elasticsearch
Work.re_initialize_elasticsearch
Work.import_elasticsearch 自訂的 Import
User.import Import 全部的資料
brew install influxdb
ln -sfv /usr/local/opt/influxdb/*.plist ~/Library/LaunchAgents
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.influxdb.plist
基本上 host 沒資料的話,就不會丟東西給 influxdb
# vi application.yml
InfluxDB:
host: '127.0.0.1'
port: 8086
db_name: 'mydb'
username: 'root'
password: 'root'
$ influx -execute 'CREATE DATABASE mydb;'