2008年5月6日 星期二

erube

deal with the file includes html & ruby code

install:

set link:
sudo ln -s /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/eruby /usr/local/bin/eruby

combine apache & erube:
set link:
     ln -s /usr/local/bin/eruby /Library/WebServer/CGI-Executables/eruby
edit /etc/apache2/httpd.conf
(1) red part
    
    AllowOverride None
    Options FollowSymLinks
(2) add following to 
    AddHandler rubypage .erb .rhtml
    Action rubypage /cgi-bin/eruby

run eruby:
eruby  test.html.erb

erb 

沒有留言: