PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.lang.ruby > rbTenjin + Apache?
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
rbTenjin + Apache?

Réponse
 
LinkBack Outils de la discussion
Vieux 16/09/2007, 14h32   #1 (permalink)
Marc Heiler
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut rbTenjin + Apache?

Hi,


http://www.kuwata-lab.com/tenjin/rbt...ide.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/.

  Réponse avec citation
Vieux 16/09/2007, 14h38   #2 (permalink)
Konrad Meyer
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: rbTenjin + Apache?

--nextPart4427138.uqEtfOPxrY
Content-Type: text/plain;
charset="utf-8"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

Quoth Marc Heiler:
> Hi,
>=20
>=20
> http://www.kuwata-lab.com/tenjin/rbt...ide.html#intro
>=20
> looks nice. Does someone know how to set it up with Apache?
> (Both are already installed and work on my linux box here)


Looks like a cross between erb (google it) and PHP (ugh). Have you seen
Markaby / RedCloth etc? There are many nicer and more ruby-esque tools out
there.

=2D-=20
Konrad Meyer <konrad@tylerc.org> http://konrad.sobertillnoon.com/

--nextPart4427138.uqEtfOPxrY
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)

iD8DBQBG7THYCHB0oCiR2cwRAowGAJ9xZQ6aCDgdgjChT/wRGdHluuiuWQCgvudL
BKwccpjlUrO5WxqnGLiGais=
=0FB8
-----END PGP SIGNATURE-----

--nextPart4427138.uqEtfOPxrY--

  Réponse avec citation
Vieux 24/02/2008, 12h10   #3 (permalink)
Ken Le
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut 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

<IfModule mod_ruby.c>

RubyRequire apache/ruby-run

<Files *.rbx>
Options ExecCGI
SetHandler ruby-object
RubyHandler Apache::RubyRun.instance
</Files>

</IfModule>
----------------------------------------


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
------------------------------------------------
<h1>#{@title}</h1>
------------------------------------------------

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/rbt...ide.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/.

  Réponse avec citation
Vieux 25/02/2008, 06h08   #4 (permalink)
Ken Le
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: rbTenjin + Apache?

Marc Heiler wrote:
> Hi there,
>
> Thanks for the !


I forgot to mention, you will need to have write permissions on the
directory where your template (e.g. file.rbhtml) is placed in. This is
because tenjin creates a .cache version of your .rbhtml in the same
directory, thus if you do not have write permissions, it will not work.
--
Posted via http://www.ruby-forum.com/.

  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 01h32.


Édité par : vBulletin® version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,09639 seconds with 12 queries