LoginSignup
2
2

More than 5 years have passed since last update.

10分でrubotyを動かす方法

Last updated at Posted at 2016-07-20

前提

この導入方法は、rubotyの設置先がec2。
adapterがslackという前提で記述しています。

必要な事前設定

  • ruby
  • bundler
  • direnv
  • libstdc++
# libstdc++のinstall方法
sudo yum install gcc-c++

botの作成

botの初期設定

% mkdir ruboty_sample                                                         
% cd ruboty_sample
% touch .envrc
% touch Gemfile
# Gemfileを書き換える
% bundle install
source 'https://rubygems.org'

gem 'ruboty'
gem 'ruboty-slack_rtm'

Slack Adapterの設定

rubotyのslack adapterは下記2点のものが代表的なものです。

ruboty-slackは slack teemのadmin権限が必要で
色々と面倒だったので、今回は ruboty-slack_rtmを利用しました。
slack integrationでhubotを用意し、そのAPI tokenを環境変数として指定して上げれば
それで完了です。

注意:
ruboty-slackも、ruboty-slack_rtmも、
接続が切れた場合、再接続がされません。
https://github.com/rosylilly/ruboty-slack_rtm/pull/23/files

実運用する場合は、下記記事を読みながら再起動させる仕組みが必要となります。
http://blog.aqutras.com/entry/2016/06/08/210000

botの実行

起動してみる

% direnv allow
% bundle exec ruboty &

動かしてみる

スクリーンショット 2016-07-20 午後2.10.59.png

2
2
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
2
2