kekshd / keks

an elearning system with basic answer types yes/no/matrix
http://keks.uni-hd.de
ISC License
10 stars 4 forks source link

Build Status Coverage Status Code Climate

Note: KeKs has been deprecated. Its functionality has been integrated to MaMpf.

KeKs is a common Rails application and may be installed like any other Rails app. The project is currently available in German only. The following describes one way to set it up on Debian stable.

general details

The project setup…

required packages

for production: ruby1.9.1 graphviz libxml2-dev libxslt-dev ruby1.9.1-dev

getting ruby and gems to work

I assume KeKs is being run as its own user. To avoid having to set the path to Ruby manually each time, modify your shell-rc file to include

alias ruby="/usr/bin/ruby1.9.1"
alias gem="/usr/bin/gem1.9.1"

If you don’t want to install gems globally, also decide on a path where the gems should be installed. Say the gem install path should be/srv/keks/GEMS then add this to your shell-rc file as well:

export PATH=/srv/keks/GEMS/bin:$PATH
export GEM_HOME=/srv/keks/GEMS
export GEM_PATH=/srv/keks/GEMS

To verify it works, run ruby -v. It should print something like ruby 1.9.2p0 (2010-08-18 revision 29036) [x86_64-linux].

You also need bundler to install all the dependencies for you. Install it by running gem install bundler. If everything is setup up correctly you should be able to type bundle help and see its man page. Note the spelling: the executable is without r while the gem name includes it.

setup (production only)

Note you need to be in production mode in order for the sub-URI magic to work.

On each update run rake assets:precompile to recompile the JS or CSS files. Similarly run rake db:migrate to incorporate changes into the DB.

connecting it to the outside world

cat /etc/apache2/sites-available/keks

 # don’t forget to set in config/environments/production.rb too

 ProxyPass /keks/ http://localhost:3000/
 ProxyPassReverse /keks/ http://localhost:3000/

Run sudo a2ensite keks to enable or disable the reverse proxy. If you plan to deploy it to a sub-URI (e.g. yoursite.com/keks123/) you need to let know Rails know about this before starting the server. For the example, this would look like this: export RAILS_RELATIVE_URL_ROOT=/keks123 rails server

handling reboots

For Debian stable the best approach is probably using an init file and start-stop-daemon to manage the server. You can find an example in initscript-example. Adjust the paths, copy it to /etc/init.d/ and make it executable. The filename should be the same as given in the “Provides:” directive on top of the file. That’ll be keks most likely.

setup (development)

Note: If you’ve set up the production environment above, be sure to rm -rf .bundle. Otherwise bundle install will not install the development environments.

KeKs dev setup uses guard and zeus to speed up common operations. Basically run guard in a terminal and use the following commands:

With guard running, it should automatically reload the web page if you make changes.

Additionally, if you install RailsPanel in Chrome you should get development output directly in Chrome’s dev tools.