LoginSignup
9
10

More than 5 years have passed since last update.

ローカル環境で、エラー管理Webアプリ「Errbit」を構築してみた

Last updated at Posted at 2014-04-18

経緯

これまでメールでのエラー管理をしてきたが、24時間365日、
私が確認できる訳ではないので、別の方法を模索してきた。

サーバの監視にZabbixを利用しており、Zabbix_senderを利用できるのでは!?とも思いつつ、
いろいろなツールを探してきたところ、ErrbitというWebアプリを見つけた。

"Errbit"で検索すると、herokuでのインストール方法ばかりだが、
ローカルインストールも可能と公式に載ってたので、まずはサーバのインストールを試してみた。

環境

OS X 10.9.2 / vagrant ( Debian-wheezy ) #OSのバージョンが違うので、修正。
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]

Errbit http://errbit.github.io/errbit/

インストール

$ sudo apt-get update
$ sudo apt-get install mongodb
$ sudo apt-get install libxml2 libxml2-dev libxslt-dev libcurl4-openssl-dev
$ sudo gem install bundler

と、ここまでは公式ドキュメントどおり。
次の箇所でこけた。

$ bundle install
(中略)
An error occurred while installing therubyracer (0.12.0), and Bundler cannot
continue.
Make sure that `gem install therubyracer -v '0.12.0'` succeeds before bundling.

gem updateしてなかった(忘れてた)からなのか不明ですが、
therubyracer -v '0.12.0'を入れろ、と怒られた。

$ sudo gem install therubyracer

としたら、今度はg++がなくて、makeができない!と><

$ sudo apt-get install g++
$ sudo gem install therubyracer
$ bundle install

よし、通った。

$ bundle exec rake errbit:bootstrap
Copying example config files...
-- Copying config/config.example.yml to config/config.yml
-- Copying config/deploy.example.rb to config/deploy.rb
-- Copying config/mongoid.example.yml to config/mongoid.yml

Seeding database
-------------------------------
Creating an initial admin user:
-- email:    ****@*******
-- password: ******

Be sure to change these credentials ASAP!

すると、emailとpasswordが表示されます。
ログイン時に必要なので、メモをしておいて下さい。

$ bundle exec script/rails server
=> Booting WEBrick
=> Rails 3.2.17 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server

これで、IP:3000でアクセスすればWebから操作が可能になります。

WEBrickエラーの対応

ちょっとWebで操作をしていたら、ターミナルに以下のエラーがたくさんw

WARN  Could not determine content-length of response body. Set content-length of the response or set Response#chunked = true

調べたところ、Ruby 1.9.3で出るエラーとのこと。
Ruby1.9.3のWebrickで出るCould not determine content-length...エラーを消す方法(2.0.0では解決済)

パッチを当てれば直るようですが、取り敢えず今回は放置で。

プラグイン

flippa/errbit-php
emgiezet/errbitPHP

こちらはこれから要検証。これが使えたら幅が広がるな。

9
10
0

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
9
10