やろうとしたこと
以下の記事を参考に、さくらのVPSに Hubot をインストールして、Slack Bot を作成しようとした。
https://cncgl.github.io/2015/07/09/Hubot-Slack-VPS.html
環境
- CentOS 7(さくらVPS)
- npm 1.4.14
- Node.js 0.10.29
- Hubot 2.19.0
Slack 上から ping しても PONG(応答)してくれない
本題。
@hubot(ボット名) ping
しても PONG してくれない。
いくら ping しても返してくれない。
こんなに 私は ping してるのに、PONG してくれないなんて。。
どうせ他の人に PONG してるんでしょ。。
ところが突然できた
原因
ずっとダイレクトメッセージ(チャット)で ping してたが、
general などに invite(招待)しないと応答しないらしい。
おまけ:npm ERR! Error: EACCES: permission denied
タイトルの件でハマる前に、諸々の設定を終え、いざ Bot を作成しようとしたところ上記のエラーになった。
[root@hoge hubot]# yo hubot
? ==========================================================================
We're constantly looking for ways to make yo better!
May we anonymously report usage statistics to improve the tool over time?
More info: https://github.com/yeoman/insight & http://yeoman.io
========================================================================== Yes
_____________________________
/ \
//\ | Extracting input for |
////\ _____ | self-replication process |
//////\ /_____\ \ /
======= |[^_/\_]| /----------------------------
| | _|___@@__|__
+===+/ /// \_\
| |_\ /// HUBOT/\\
|___/\// / \\
\ / +---+
\____/ | |
| //| +===+
\// |xx|
? Owner komatzz
? Bot name hubot
? Description A simple helpful robot for your Company
? Bot adapter campfire
create bin/hubot
create bin/hubot.cmd
create Procfile
create README.md
create external-scripts.json
create hubot-scripts.json
create .gitignore
create package.json
create scripts/example.coffee
create .editorconfig
_____________________________
_____ / \
\ \ | Self-replication process |
| | _____ | complete... |
|__\\| /_____\ \ Good luck with that. /
|//+ |[^_/\_]| /----------------------------
| | _|___@@__|__
+===+/ /// \_\
| |_\ /// HUBOT/\\
|___/\// / \\
\ / +---+
\____/ | |
| //| +===+
\// |xx|
npm WARN install Refusing to install hubot as a dependency of itself
npm ERR! Linux 3.10.0-327.28.3.el7.x86_64
npm ERR! argv "/root/.nvm/versions/io.js/v3.3.1/bin/iojs" "/root/.nvm/versions/io.js/v3.3.1/bin/npm" "install" "hubot" "hubot-scripts" "hubot-diagnostics" "hubot-help" "hubot-heroku-keepalive" "hubot-google-images" "hubot-google-translate" "hubot-pugme" "hubot-maps" "hubot-redis-brain" "hubot-rules" "hubot-shipit" "--save"
npm ERR! node v3.3.1
npm ERR! npm v2.14.3
npm ERR! path /root/.npm/hubot-redis-brain
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall mkdir
npm ERR! Error: EACCES: permission denied, mkdir '/root/.npm/hubot-redis-brain'
npm ERR! at Error (native)
npm ERR! { [Error: EACCES: permission denied, mkdir '/root/.npm/hubot-redis-brain']
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'mkdir',
npm ERR! path: '/root/.npm/hubot-redis-brain',
npm ERR! parent: 'hubot' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! Please include the following file with any support request:
npm ERR! /root/hubot/npm-debug.log
解決策
ディレクトリのパーミッションを変更する。
chmod -R 0777 /root/.npm/
とりあえず動かしたいので強い権限にした。