building a rails 3 turnkey cyber-dojo server




I've been working on building a Cyber-Dojo VirtualBox Turnkey image that uses rails 3 and ruby 1.9.3 on top of the Turnkey Rails app. I figured the steps involved might be useful for someone so here they are. You can also download them as a shell file here .

First I removed the existing ruby
# cd ~
# apt-get purge ruby-enterprise
Then install libyaml
# cd ~
# wget http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz
# tar xzf yaml-0.1.4.tar.gz
# cd yaml-0.1.4
# ./configure
# make
# make install
Then install the version of Ruby I want (this takes quite a while)
# cd ~
# wget http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p125.tar.gz
# tar xzf ruby-1.9.3-p125.tar.gz
# cd ruby-1.9.3-p125
# ./configure --disable-install-doc
# make
# make install
Then pull the rails3 Cyber-Dojo source (hit return when it asks for a password). I got some utf-ascii conversion warnings which don't seem to matter. When asked if I wanted to overwrite an executable I responded [y]es. This too takes quite a while.
# cd /var/www
# git clone https://JonJagger@github.com/JonJagger/cyberdojo
# chown -R www-data cyberdojo
# chgrp -R www-data cyberdojo
# cd cyberdojo
# gem update --system
# gem update --no-rdoc
# gem install bundle --no-ri --no-rdoc
# bundle install
Then setup apache
# cd /etc/apache2/sites-enabled
# sed s/railsapp/cyberdojo/ <railsapp >cyberdojo
# rm railsapp
# cd /etc/apache2/sites-available
# sed s/railsapp/cyberdojo/ <railsapp >cyberdojo
# rm railsapp
# cd /etc/apache2/conf
# sed s/railsapp/cyberdojo/ <railsapp.conf >cyberdojo.conf
# rm railsapp.conf
Then setup passenger (it takes quite a while), and edit /etc/apache2/conf.d/passenger as directed by the output
# cd ~
# apt-get update
# apt-get install libcurl4-openssl-dev
# cd /var/www/cyberdojo
# gem install passenger --no-ri --no-rdoc
# passenger-install-apache2-module
Then
# cd /var/www/cyberdojo
# service apache2 restart
And viola, Cyber-Dojo was up. Saving to a .ova file creates a 418MB file. This will give you C and C++ (gcc 4.4.5), Perl (5.10.1), Python (2.6.6), Ruby (1.9.3). If you want to upgrade any of these or use any of the other languages you'll need to install their compilers and unit test frameworks. The instructions in the github readme might be useful.

cyber-dojo Skillsmatter podcast

I had the pleasure of running a Cyber-Dojo at Skillsmatter's 2 day Progressive Java tutorial last week. The session was video'd and is available here.