From: WibbleCP Date: 2007-09-30T01:42:56+09:00 Subject: erb - erubis problems ------=_Part_6600_1263746.1191084175291 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi all, I have some problems using erb(o erubis) + cgi I am able to use single rb files or rhtml, but when I try to use a structure like that: file.rb+file.eruby I have an internal server error (500) I know, these problems are really by newbie. I show you my files. ---------- file.rb ----------- #!/usr/bin/ruby require 'rubygems' require 'erubis' input = File.read('file.eruby') eruby = Erubis::Eruby.new(input, :trim=>false) list = ['aaa', 'bbb', 'ccc'] puts eruby.result(binding()) ## using eruby.evaluate(...) -------------- file.eruby ------------- opening file.rb in my browser (in the shell it works fine, showing me the html code) , apache server responds to: [error] mod_ruby: error in ruby [error] mod_ruby: /usr/lib/ruby/gems/1.8/gems/erubis-2.4.1/lib/erubis/evaluator.rb:62:in `eval': Insecure operation - eval (SecurityError) [error] mod_ruby: from /usr/lib/ruby/gems/1.8/gems/erubis-2.4.1/lib/erubis/evaluator.rb:62:in `result' [error] mod_ruby: from /home/indaco/public_html/file.rb:12 [error] mod_ruby: from /usr/lib/ruby/1.8/apache/ruby-run.rb:53:in `load' [error] mod_ruby: from /usr/lib/ruby/1.8/apache/ruby-run.rb:53:in `handler' ------------------------------- My httpd.conf is like: ------------------------------- ScriptAlias /cgi-bin/ /usr/local/apache2/cgi-bin/ UserDir public_html Options ExecCGI SetHandler cgi-script Options ExecCGI SetHandler cgi-script AddHandler cgi-script .rb .rbx .cgi .pl # If the ruby module is installed, this will be enabled. # # for Apache::RubyRun RubyRequire apache/ruby-run # # for Apache::ERubyRun RubyRequire apache/eruby-run # # for Apache::ERbRun RubyRequire apache/erb-run # # for debug RubyRequire auto-reload # exec files under /ruby as ruby scripts. SetHandler ruby-object RubyHandler Apache::RubyRun.instance Options +ExecCGI # # # handle files under /eruby as eRuby files by eruby. SetHandler ruby-object RubyHandler Apache::ERubyRun.instance # # # handle files under /erb as eRuby files by ERb. SetHandler ruby-object RubyHandler Apache::ERbRun.instance # exec *.rb as ruby scripts. SetHandler ruby-object RubyHandler Apache::RubyRun.instance # exec *.rbx as ruby scripts. SetHandler ruby-object RubyHandler Apache::RubyRun.instance # # # handle *.rhtml as eruby files. SetHandler ruby-object RubyHandler Apache::ERubyRun.instance Please help me in some way! Thanks ------=_Part_6600_1263746.1191084175291--