Comparing
version 22 and
version 21 backh1. Howto setup Ruby on Rails and Active RDF and Sesame in Ten Steps
h2. 1. get jruby
get jruby, as described in "this guide":http://jruby.codehaus.org/The+JRuby+Tutorial+Part+1+-+Getting+Started
Dont forget to export JRUBY_HOME and include JRUBY_HOME/bin in your path.
I currently (as of 6-Feb-2006) recommend revision 2886, so that would be:
svn co -r 2886 svn://svn.codehaus.org/jruby/trunk/jruby jruby-trunk
If something does not work, you can try to update your jruby-trunk.
Go into your JRUBY_HOME, and do "ant clean test" to build
jruby and run the tests. hopefully all tests pass.
h2. 2. alwayalways check your path
from now on make sure that only jruby versions of all relevant ruby tools are used.
h2. 3. install ruby on rails:
gem install rails --include-dependencies --no-rdoc --no-ri
h2. 4. install rake:
gem install rake --include-dependencies --no-rdoc --no-ri
h2. 5. install activerdf and activerdf-sesame
gem install activerdf-sesame --include-dependencies --no-rdoc --no-ri
You can get them from http://rubyforge.org/projects/activerdf/ , if the rubygems mirrors are not quick enough for this howto.
h2. 6. set your java classpath
set your java classpath to include the sesame jars, which are a part of the sesame adapter.
these jars should be in JRUBY_HOME/lib/ruby/gems/1.8/gems/activerdf_sesame-0.1/ext/ or similiar.
we will define JRUBY_HOME/lib/ruby/gems/1.8/gems/activerdf_sesame-0.1/ to be SESAME_ADAPTER
then do:
export CLASSPATH=$SESAME_ADAPTER/ext/wrapper-sesame2.jar;$SESAME_ADAPTER/ext/openrdf-sesame-2.0-alpha4-onejar.jar
%{color:red}WARNING%: this step is extremely necessary, and also the one you will most likely forget. If possible put this into your .bashrc or .zshrc. We hope to be able to do this automatically in future versions.
h2. 7. run the sesame adapter tests
cd $SESAME_ADAPTER/test
jruby test_sesame_adapter.rb
dont worry about java warnings, just make sure that the unit test summary mentions no errors or warnings from (j)ruby.
h2. 8. modify the rails application
perform the steps in the Getting Started Guide in the the section "The Semantic Web on Rails" at the bottom. see http://wiki.activerdf.org/GettingStartedGuide
h2. 9. start your ruby on rails application
you can now start your ruby on rails application using jruby like this:
jruby ./script/server
h2. 10. welcome to the semantic underground
if you have come this far, then you are one of the lucky few persons in the world, who could potentialy build a ruby on rails application which uses rdfs inferencing. Please report your success to the activerdf users mailing list at activerdf@lists.deri.org :)
(Underground, because we dont use java per se, it is more like just using java to reach our goals, instead of wholeheartedly loving java, and promising it to get a house and 7 children. :P )