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

Webアプリのエラー管理・通知システム「Errbit」の起動までの作業メモ

More than 5 years have passed since last update.

はじめに

  • Errbit の起動までの作業メモ
  • Ubuntu 14.10 で実行
  • 基本的には公式ドキュメントの通り

実行環境の準備

MongoDB

$ sudo apt-get update
$ sudo apt-get install mongodb

その他諸々

$ sudo apt-get install libxml2 libxml2-dev libxslt-dev libcurl4-openssl-dev libzip-dev libssl-dev

Bundler

$ sudo gem install bundler

Errbit の準備

GitHub からソースを取得

$ cd /path/to/
$ git clone https://github.com/errbit/errbit.git

bundle install

エラーが出ました。

$ bundle install --path vendor/bundle

...

Installing i18n 0.7.0

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    /usr/bin/ruby2.1 extconf.rb 
mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h

extconf failed, exit code 1

Gem files will remain installed in /home/suna/projects/errbit/vendor/bundle/ruby/2.1.0/gems/json-1.8.2 for inspection.
Results logged to /home/suna/projects/errbit/vendor/bundle/ruby/2.1.0/extensions/x86_64-linux/2.1.0/json-1.8.2/gem_make.out
An error occurred while installing json (1.8.2), and Bundler cannot continue.
Make sure that `gem install json -v '1.8.2'` succeeds before bundling.

メッセージの通り、gem install json -v '1.8.2' を試してみましたがエラーでした。

$ sudo gem install json -v '1.8.2'
Fetching: json-1.8.2.gem (100%)
Building native extensions.  This could take a while...
ERROR:  Error installing json:
    ERROR: Failed to build gem native extension.

    /usr/bin/ruby2.1 extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h

extconf failed, exit code 1

Gem files will remain installed in /var/lib/gems/2.1.0/gems/json-1.8.2 for inspection.
Results logged to /var/lib/gems/2.1.0/extensions/x86_64-linux/2.1.0/json-1.8.2/gem_make.out

こちらの記事を参考にさせて頂き、以下のコマンドを実行します。

$ sudo apt-get install ruby-dev

再度、bundle install を実行します。今度は正常に完了しました。

$ bundle install --path vendor/bundle

DB の準備

errbit:bootstrap は、db:seed と db:mongoid:create_indexes を実行しているようです。
create_indexes のログで流れて見逃してしまいがちですが、db:seed のログで 「ユーザID」「パスワード」 が表示されています。

$ bundle exec rake errbit:bootstrap
Seeding database
-------------------------------
Creating an initial admin user:
-- email:    errbit@errbit.example.com
-- password: xxxxxxxxxxxx

Be sure to note down these credentials now!

I, [2015-03-15T04:30:50.933408 #30836]  INFO -- : MONGOID: Created indexes on Backtrace:
I, [2015-03-15T04:30:50.933613 #30836]  INFO -- : MONGOID: Index: {:fingerprint=>1}, Options: {}

...

I, [2015-03-15T04:30:50.980953 #30836]  INFO -- : MONGOID: Index: {:authentication_token=>1}, Options: {}

Errbit の起動

$ bundle exec rails s
=> Booting WEBrick
=> Rails 4.1.8 application starting in development on http://0.0.0.0:3000
=> Run `rails server -h` for more startup options
=> Notice: server is listening on all interfaces (0.0.0.0). Consider using 127.0.0.1 (--binding option)
=> Ctrl-C to shutdown server
[2015-03-15 04:40:52] INFO  WEBrick 1.3.1
[2015-03-15 04:40:52] INFO  ruby 2.1.2 (2014-05-08) [x86_64-linux-gnu]
[2015-03-15 04:40:52] INFO  WEBrick::HTTPServer#start: pid=303 port=3000

Errbit にアクセス

ブラウザからアクセス

rake db:seed で生成された ID, パスワードで Sign in します。

2015031501.png

「Sign in」後

2015031502.png

感想

  • 監視するアプリの登録、他サービスへの通知連携等は、また後でやるかも。
Suna
Why not register and get more from Qiita?
  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
No 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
ユーザーは見つかりませんでした