Skip to content

Instantly share code, notes, and snippets.

@dlecocq
Last active December 14, 2015 12:09
Show Gist options
  • Save dlecocq/5084235 to your computer and use it in GitHub Desktop.
Save dlecocq/5084235 to your computer and use it in GitHub Desktop.
Qless Setup
# You'll need a few tools to get you going
sudo apt-get update
sudo apt-get install -y make g++
# If you need redis, this should get you going
export REDIS_VERSION=2.6.7
cd && curl -O http://redis.googlecode.com/files/redis-$REDIS_VERSION.tar.gz
tar xf redis-$REDIS_VERSION.tar.gz
cd redis-$REDIS_VERSION
make && sudo make install
# This is where Redis should save its data
export REDIS_DIRECTORY='/mnt/redis'
sudo chown -R ubuntu:ubuntu `dirname $REDIS_DIRECTORY`
mkdir -p $REDIS_DIRECTORY
# And now, we'll configure it
sed -i 's#daemonize no#daemonize yes#' redis.conf
sed "s#dir ./#dir $REDIS_DIRECTORY#" redis.conf | sudo tee /etc/redis.conf
sudo chown ubuntu:ubuntu /etc/redis.conf
# And start it up
redis-server /etc/redis.conf
# We need ruby 1.9+. Conveniently, 1.9.1 is available in aptitude
sudo apt-get install -y ruby1.9.1{,-dev}
gem1.9.1 install qless --no-ri --no-rdoc
# Now, we should be able to invoke qless-web
qless-web
###################################################################
# Troubleshooting
###################################################################
# If it gives you some grief, make sure that ruby1.9.1 is now your
# default ruby installation. This should say 1.9.1
ruby --version
@sistawendy
Copy link

More on this gist:

me: Ah hah! Before you can run bundle, first you need to do:
sudo rvm pkg install openssl
The output from that will tell you to do:
rvm reinstall all --force
I had a little funniness with a .rvmrc in git/qless that wanted ruby-1.9.3-p392 instead of p194.
I removed that .rvmrc.
Dan: Is it happy now?
me: Let me get redis installed, then I'll try starting qless and hitting its web page.
Sent at 3:12 PM on Wednesday
me: Oh, and the first two chunks of the freshscape gist definitely need to get run before any of the qless gist.
...Because the qless gist relies on the RAID setup.
Sent at 3:26 PM on Wednesday
me: And I think the /etc/ needs to go away from:
sed -i "s#dir ./#dir $REDIS_DIRECTORY#" /etc/redis.conf
Because you cp redis.conf /etc/redis.conf on the next line.
Sent at 3:29 PM on Wednesday
me: Here's one that I've run into before:
ubuntu@fresh-test-crawl-01:~/git/qless$ ruby exe/qless-web
/home/ubuntu/git/qless/lib/qless/lua_script.rb:15:in read': No such file or directory - /home/ubuntu/git/qless/lib/qless/qless-core/cancel.lua (Errno::ENOENT) from /home/ubuntu/git/qless/lib/qless/lua_script.rb:15:inreload'
from /home/ubuntu/git/qless/lib/qless/lua_script.rb:9:in initialize' from /home/ubuntu/git/qless/lib/qless/lua_script_cache.rb:13:innew'
from /home/ubuntu/git/qless/lib/qless/lua_script_cache.rb:13:in block in script_for' from /home/ubuntu/git/qless/lib/qless/lua_script_cache.rb:12:infetch'
from /home/ubuntu/git/qless/lib/qless/lua_script_cache.rb:12:in script_for' from /home/ubuntu/git/qless/lib/qless.rb:166:inblock in initialize'
from /home/ubuntu/git/qless/lib/qless.rb:163:in each' from /home/ubuntu/git/qless/lib/qless.rb:163:ininitialize'
from exe/qless-web:12:in new' from exe/qless-web:12:in

'
Dan: cd ~/git/qless && git submodule init && git submodule update

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment