From: Ken Le Date: 2008-02-24T21:10:16+09:00 Subject: Re: rbTenjin + Apache? This is how I did it, I am not an Apache guru so please correct me anybody if this is a bad way to do it: For Ubuntu 7.10 and assuming you already have mod_ruby and ruby gems installed: 1) Install tenjin gem install tenjin 2) Make make a file named ruby.conf under /etc/apache2/conf.d Add the following into ruby.conf -------------------------------------- AddType text/html .rbx RubyRequire apache/ruby-run Options ExecCGI SetHandler ruby-object RubyHandler Apache::RubyRun.instance ---------------------------------------- 3) Go into /usr/lib/ruby/1.8/apache/ruby-run.rb Add the following under where it says 'require "singleton"' --------------------------------------- require "singleton" require "rubygems" require "tenjin" ---------------------------------------- 4) Test it out: Go to your Apache Document Root where you serve your files. Create a file named main.rbx and enter the following: ----------------------------------------------- engine = Tenjin::Engine.new() context = {:title=>'Hello World'} filename = 'file.rbhtml' output = engine.render(filename, context) puts output ------------------------------------------------ Create a template named file.rbhtml and include the following ------------------------------------------------

#{@title}

------------------------------------------------ Goto your browser and type in: YOURDOMAIN/main.rbx Your browser should then display "Hello World". Marc Heiler wrote: > Hi, > > > http://www.kuwata-lab.com/tenjin/rbtenjin-users-guide.html#intro > > looks nice. Does someone know how to set it up with Apache? > (Both are already installed and work on my linux box here) -- Posted via http://www.ruby-forum.com/.