Help us understand the problem. What is going on with this article?

書籍「データ分析基盤構築入門」のサンプルアプリケーションを動かす時にハマった箇所メモ

More than 1 year has passed since last update.

http://gihyo.jp/book/2017/978-4-7741-9218-5

こちらの本に従いサンプルアプリケーションを動かそうと思ったが幾つかハマりどころがあったのでメモ

実行環境は

mac ox 10.11.6
docker Version 17.09.0-ce-mac35 (19611)
※ docker for mac でインストール

本に従いgithubからclone後に

$ docker-compose up -d

を行うと fluent-plugin-elasticsearch のインストールでエラーが発生

GCCがインストールされていないのが原因のようだったので、Dockerfile-fluentdRUN sudo apt-get install build-essential -yを追記して色々インストールすると通った。

Dockerfile-fluentd
FROM debian:jessie

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get -qq update && apt-get install --no-install-recommends -y curl ca-certificates sudo 
RUN sudo apt-get install build-essential -y # この行を追加
RUN curl -L https://toolbelt.treasuredata.com/sh/install-debian-jessie-td-agent2.sh | sh
RUN /usr/sbin/td-agent-gem install fluent-plugin-elasticsearch fluent-plugin-record-reformer

EXPOSE 24224

CMD exec td-agent -c /fluentd/etc/$FLUENTD_CONF -p /fluentd/plugins $FLUENTD_OPT

これでdocker-compose up -dが最後まで通ったのでhttp://localhost/にアクセスするとno such table: articles とでたのでマイグレーションが実行されていない感じ。

$ docker-compose exec go make migrate/up

を実行すると

go get github.com/rubenv/sql-migrate/...
/go/bin/sql-migrate up -env=development
Applied 2 migrations

という感じでマイグレーションされた模様。

再びアクセスすると無事画面が表示された。

Why do not you register as a user and use Qiita more conveniently?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away