Skip to content

Instantly share code, notes, and snippets.

@weshouman
Last active October 28, 2017 06:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save weshouman/3faba009b1eb665816ba to your computer and use it in GitHub Desktop.
Save weshouman/3faba009b1eb665816ba to your computer and use it in GitHub Desktop.
installing hubot notes setup
Dependencies
------------
sudo apt-get update
## was requested but I already had it
sudo apt-get install build-essential
# installing node
sudo add-apt-repository -m ppa:chris-lea/node.js
# in case add-apt-repository wasn't found use $ sudo apt-get update
sudo apt-get update
sudo apt-get install nodejs
# check node is running
# test by pasting the following into a shell
cat > ~/server.js <<EOF
var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello World\n');
}).listen(1337, "127.0.0.1");
console.log('Server running at http://127.0.0.1:1337');
EOF
# then use
node ~/server.js
# then check "Hello World" found in http://127.0.0.1:1337
# BINGO node is installed :D
## if u ever tried to install npm ... it's already bundled with nodejs ... reinstalling it will show a dependency error (that's so OK!)
# install git
## it was already installed, no need for me to install it :D
# install other dependencies
sudo apt-get install libssl-dev redis-server libexpat1-dev
# some dependencies in node too
sudo npm install -g coffee-script
# clone hubot wherever u want #assuming its .
git clone git://github.com/github/hubot.git
Installing Hubot
---------------
cd master && sudo npm install
install hubot itself: (ref: master/docs/index.md)
sudo npm install -g yo generator-hubot
(if a newer npm version is required): (ref: https://libraries.io/npm/npm/2.8.0)
mkdir ../npm && cd ../npm
curl -L https://www.npmjs.com/install.sh | sh
(if a higher access is required):
curl -L https://www.npmjs.com/install.sh | sudo sh
Execute Hubot
---------------
./bin/hubot
# here I got the following error: "ERROR Error: listen EADDRINUSE", the error means the port (8080) is already taken
# 2 solutions we have got here:
# [1] use this command to know which app is taking it then close it
lsof -i :8080
# [2] make both hubot and the other app listening to 8080 work together
# that's even simpler, we'll need to define the env. variable PORT with a value ... 9090 as an example and execute hubot over this port
export PORT=9090
./bin/hubot
# now there's no port conflict but hubot is still not answering :/
# if we used: sudo make ... tests will work, except for 'Robot "before each" hook:' which throws "Uncaught Error: listen EADDRINUSE"
## my reference: http://how-to.linuxcareer.com/how-to-install-and-use-hubot-robot-on-ubuntu-machine?google_comment_id=z12aif3xvvv0ijsqe04cg51hwmmxj50px4g
## another ref: http://blog.diniscruz.com/2013/06/trying-to-running-hubot-and-being-stuck.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment