Apache2 conf and mod_ruby (mac os x 10.4.11)

in my httpd.conf i have :

LoadModule ruby_module libexec/httpd/mod_ruby.so

AddModule mod_ruby.c

and :

for Apache::RubyRun

RubyRequire apache/ruby-run

exec files under /ruby as ruby scripts.

<Location /ruby>
SetHandler ruby-object
RubyHandler Apache::RubyRun.instance
Options +ExecCGI

for rbx files

<Directory /Users/yt/Sites/*>
Options +ExecCGI

exec *.rbx as ruby scripts.

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

# for Apache::ERubyRun

RubyRequire apache/eruby-run

# handle files under /eruby as eRuby files by eruby.

<Location /eruby>
SetHandler ruby-object
RubyHandler Apache::ERubyRun.instance

# handle *.rhtml as eruby files.

<Files *.rhtml>
SetHandler ruby-object
RubyHandler Apache::ERubyRun.instance

# for Apache::ERbRun

RubyRequire apache/erb-run

# handle files under /erb as eRuby files by ERb.

<Location /erb>

SetHandler ruby-object

RubyHandler Apache::ERbRun.instance

# for debug

#RubyRequire auto-reload

DirectoryIndex index.html index.rhtml

AddType application/x-httpd-eruby .rhtml
Action application/x-httpd-eruby /cgi-bin/eruby

however any attempt to read a *.rbx or *.rhtml gave me the text content
of the script itself.

i’ve checked the syntax of httpd.conf, according to apachectl -t, it is
correct.

i’m running Mac 0S 10.4.11 with :
ruby 1.8.6 (2007-09-24 patchlevel 111) [powerpc-darwin8.11.0]
eRuby version 1.0.5

how could i debugg this stuff ?

I’m not too familiar with it, but it may be an additional Option you
need to add or an AddHandler.
-R

On Mon, Apr 28, 2008 at 6:00 AM, Une Bévue

Roger P. [email protected] wrote:

I’m not too familiar with it, but it may be an additional Option you
need to add or an AddHandler.

thanks for your answer, i discovered, in the mean time, Apache 2, is
unable to load mod_ruby.so because of a symbol not found, expected in a
flat name space…

i fall back to Apache 1.3, the Apple’s default wich works at least, for
the time being, with rbx files in any directory…

also i wanted to compile the latest mod_ruby, but it fails.

i suspect something wrong in my manuall Apache 2 install (i wanted to
link the latest mod_ruby with this apache 2)…

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

I’m using mod_ruby with apache 2.2.6 without any issues. I manually
compiled and installed both apache and mod_ruby so I’m not sure of how
much help I’ll be.

My config is pretty simple:

LoadModule ruby_module /usr/local/apache2/modules/mod_ruby.so

~ RubyRequire apache/ruby-run
~ <Files *.rbx>
~ SetHandler ruby-object
~ RubyHandler Apache::RubyRun.instance
~

~ RubyRequire apache/eruby-run
~ <Files *.rhtml>
~ SetHandler ruby-object
~ RubyHandler Apache::ERubyRun.instance
~

It’s installed here:

[email protected]:/usr/lib/ruby/1.8# ls -la apache/
total 64
drwxr-xr-x 2 root root 4096 2007-11-05 17:03 ./
drwxr-xr-x 32 root root 4096 2007-11-05 17:03 …/

  • -rw-r–r-- 1 root root 3664 2007-11-05 17:03 erb-run.rb
  • -rw-r–r-- 1 root root 3381 2007-11-05 17:03 eruby-debug.rb
  • -rw-r–r-- 1 root root 3229 2007-11-05 17:03 eruby-run.rb
  • -rw-r–r-- 1 root root 6148 2007-11-05 17:03 query.rb
  • -rw-r–r-- 1 root root 13949 2007-11-05 17:03 rails-dispatcher.rb
  • -rw-r–r-- 1 root root 3626 2007-11-05 17:03 rd2html.rb
  • -rw-r–r-- 1 root root 2353 2007-11-05 17:03 registry.rb
  • -rw-r–r-- 1 root root 3428 2007-11-05 17:03 ruby-debug.rb
  • -rw-r–r-- 1 root root 3956 2007-11-05 17:03 ruby-profile.rb
  • -rw-r–r-- 1 root root 2461 2007-11-05 17:03 ruby-run.rb
    [email protected]:/usr/lib/ruby/1.8#

Let me know if I can be of further help.

Tiago M.

Une Bévue wrote:
| Roger P. [email protected] wrote:
|
|> I’m not too familiar with it, but it may be an additional Option you
|> need to add or an AddHandler.
|
| thanks for your answer, i discovered, in the mean time, Apache 2, is
| unable to load mod_ruby.so because of a symbol not found, expected in a
| flat name space…
|
| i fall back to Apache 1.3, the Apple’s default wich works at least, for
| the time being, with rbx files in any directory…
|
|
| also i wanted to compile the latest mod_ruby, but it fails.
|
| i suspect something wrong in my manuall Apache 2 install (i wanted to
| link the latest mod_ruby with this apache 2)…
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkgXNAEACgkQxFuRTtCTMvJWnQCfWuYcBdFOUIrsmbth5vBdY7Q7
h+MAn28LQquclWD6JZRUoO8q/fGQNNdo
=eGxJ
-----END PGP SIGNATURE-----

Tiago M. [email protected] wrote:

Let me know if I can be of further help.

right now, *.rbx files are working but not *.rhtml.

with eruby the Apache2 server complains :
[Wed Apr 30 16:53:57 2008] [error] mod_ruby: failed to require
apache/eruby-run
[Wed Apr 30 16:53:57 2008] [error] mod_ruby: error in ruby
[Wed Apr 30 16:53:57 2008] [error] mod_ruby:
/opt/local/lib/ruby/1.8/apache/eruby-run.rb:45:in require': no such file to load -- eruby (LoadError) [Wed Apr 30 16:53:57 2008] [error] mod_ruby: from /opt/local/lib/ruby/1.8/apache/eruby-run.rb:45 [Wed Apr 30 16:54:23 2008] [error] mod_ruby: error in ruby [Wed Apr 30 16:54:23 2008] [error] mod_ruby: (eval):45: (eval):45: uninitialized constant Apache::ERubyRun (NameError) [Wed Apr 30 16:54:23 2008] [error] mod_ruby: from (eval):45:invalue’

the line 45 of eruby-run.rb being :

require “eruby”

i did a test changing this line to the absolute path of eruby, without
any positive effect…

even my httpd.conf is slightly different from yours, i had to add :
<Directory /Users/yt/Sites/*>
Options +ExecCGI

in order to get *.rbx files working…

Tiago M. [email protected] wrote:

Hash: SHA1

Hi,

I’m using mod_ruby with apache 2.2.6 without any issues. I manually
compiled and installed both apache and mod_ruby so I’m not sure of how
much help I’ll be.

fine, thanks, i’l re-install, manually everything…

and let u know.

Tiago M. [email protected] wrote:

I’m guessing you don’t have eruby installed:

http://wiki.modruby.net/en/?eRubyQuestions

ok, thanks, i’ll read this wiki.

i suspect the test done with eruby on command line was done with an
older eruby not linked the Apache2 (?)
even erubis is working on command line, and part of it as cgi.

Une Bévue [email protected] wrote:

ok, thanks, i’ll read this wiki.

I’d like to add a question :
what i the role of this eruby ? I mean if i do :
$ eruby --version
eRuby version 1.0.5
ruby 1.8.6 (2007-09-24 patchlevel 111) [powerpc-darwin8.11.0]

even i’ve tested eruby on cli…

also :
$ which eruby
/opt/local/bin/eruby

may be this isn’t the “same” eruby ???
I’m confused about that…

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Do you have anything similar to this?

[email protected]:~# locate eruby.so
/usr/lib/ruby/1.8/i686-linux/eruby.so

This is what apache is requiring.

Tiago M.

Une Bévue wrote:
| Une Bévue [email protected] wrote:
|
|> ok, thanks, i’ll read this wiki.
|
| I’d like to add a question :
| what i the role of this eruby ? I mean if i do :
| $ eruby --version
| eRuby version 1.0.5
| ruby 1.8.6 (2007-09-24 patchlevel 111) [powerpc-darwin8.11.0]
|
| even i’ve tested eruby on cli…
|
| also :
| $ which eruby
| /opt/local/bin/eruby
|
| may be this isn’t the “same” eruby ???
| I’m confused about that…
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkgfGDIACgkQxFuRTtCTMvKXeACfZ8TmsXVBtQIaWAy6T8DfPj65
RsAAn2opKjP+g1M846pQe+AYssUwGMpW
=GNiO
-----END PGP SIGNATURE-----

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I don’t, I use linux but you need the library and for some reason you
don’t have it.

Une Bévue wrote:
| Tiago M. [email protected] wrote:
|
|> [email protected]:~# locate eruby.so
|> /usr/lib/ruby/1.8/i686-linux/eruby.so
|
| nope, but i do have :
| /opt/local/bin/eruby (*)
|
| which i symlinked to :
| /opt/local/apache2/cgi-bin/eruby
|
| what sounds strange to me:
| previously i had the same setup BUT, reinstalling eruby (same version
| numbers) and re-doing the symlink make it working…
|
| I’m running Mac OS X 10.4.11
|
| and also :
| /opt/local/include/eruby.h
| /opt/local/lib/liberuby.a
| /opt/local/lib/ruby/1.8/apache/eruby-debug.rb
| /opt/local/lib/ruby/1.8/apache/eruby-run.rb
| /opt/local/lib/ruby/1.8/powerpc-darwin8.8.0/eruby.bundle
|
|> This is what apache is requiring.
|
| may be u don’t run the same OS ?
|
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkgfTLUACgkQxFuRTtCTMvKPcACeKxsEuPsF8u6cxrbQJwTc1VHl
3O8AnR3sl6YblK8fkSEp93QSFsshJ7a5
=qUvo
-----END PGP SIGNATURE-----

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I’m guessing you don’t have eruby installed:

http://wiki.modruby.net/en/?eRubyQuestions

Tiago M.

Une Bévue wrote:
| Tiago M. [email protected] wrote:
|
|> Let me know if I can be of further help.
|
| right now, *.rbx files are working but not .rhtml.
|
| with eruby the Apache2 server complains :
| [Wed Apr 30 16:53:57 2008] [error] mod_ruby: failed to require
| apache/eruby-run
| [Wed Apr 30 16:53:57 2008] [error] mod_ruby: error in ruby
| [Wed Apr 30 16:53:57 2008] [error] mod_ruby:
| /opt/local/lib/ruby/1.8/apache/eruby-run.rb:45:in require': no such | file to load -- eruby (LoadError) | [Wed Apr 30 16:53:57 2008] [error] mod_ruby: from | /opt/local/lib/ruby/1.8/apache/eruby-run.rb:45 | [Wed Apr 30 16:54:23 2008] [error] mod_ruby: error in ruby | [Wed Apr 30 16:54:23 2008] [error] mod_ruby: (eval):45: (eval):45: | uninitialized constant Apache::ERubyRun (NameError) | [Wed Apr 30 16:54:23 2008] [error] mod_ruby: from (eval):45:invalue’
|
|
| the line 45 of eruby-run.rb being :
|
| require “eruby”
|
| i did a test changing this line to the absolute path of eruby, without
| any positive effect…
|
|
| even my httpd.conf is slightly different from yours, i had to add :
| <Directory /Users/yt/Sites/
>
| Options +ExecCGI
|
|
| in order to get *.rbx files working…
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkgbS+kACgkQxFuRTtCTMvJdRgCfUfxhCj1b4dBAR2jBzWWZocxv
tAIAn1gRtfBrARNQ4/aj83jkXHjJGskp
=u2DD
-----END PGP SIGNATURE-----

Tiago M. [email protected] wrote:

I don’t, I use linux but you need the library and for some reason you
don’t have it.

no, no, i have it, i’m sure about that.
and it works (ie. eruby under mod_ruby)
what surprised me is that : it was already installed but didn’t work,
i’ve re-installed (same version) it and now it works…

it remains to me to get erubis working…

here i get a security error (proving that way that both eruby and erubis
are installed and working):
[Mon May 05 17:42:06 2008] [error] mod_ruby: error in ruby
[Mon May 05 17:42:06 2008] [error] mod_ruby:
/opt/local/lib/ruby/gems/1.8/gems/erubis-2.4.1/lib/erubis/evaluator.rb:6
2:in eval': Insecure operation - eval (SecurityError) [Mon May 05 17:42:06 2008] [error] mod_ruby: from /opt/local/lib/ruby/gems/1.8/gems/erubis-2.4.1/lib/erubis/evaluator.rb:6 2:inresult’
[Mon May 05 17:42:06 2008] [error] mod_ruby: from
/Users/yt/Sites/erubis/example3.rbx:15
[Mon May 05 17:42:06 2008] [error] mod_ruby: from
/opt/local/lib/ruby/1.8/apache/ruby-run.rb:53:in load' [Mon May 05 17:42:06 2008] [error] mod_ruby: from /opt/local/lib/ruby/1.8/apache/ruby-run.rb:53:inhandler’

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Honestly I don’t know what’s wrong, there is already a thread in
ruby-talk about the exact same issue with erubis and I’m not sure they
found a solution.

Tiago M.

Une Bévue wrote:
| Tiago M. [email protected] wrote:
|
|> I don’t, I use linux but you need the library and for some reason you
|> don’t have it.
|
| no, no, i have it, i’m sure about that.
| and it works (ie. eruby under mod_ruby)
| what surprised me is that : it was already installed but didn’t work,
| i’ve re-installed (same version) it and now it works…
|
| it remains to me to get erubis working…
|
| here i get a security error (proving that way that both eruby and erubis
| are installed and working):
| [Mon May 05 17:42:06 2008] [error] mod_ruby: error in ruby
| [Mon May 05 17:42:06 2008] [error] mod_ruby:
| /opt/local/lib/ruby/gems/1.8/gems/erubis-2.4.1/lib/erubis/evaluator.rb:6
| 2:in eval': Insecure operation - eval (SecurityError) | [Mon May 05 17:42:06 2008] [error] mod_ruby: from | /opt/local/lib/ruby/gems/1.8/gems/erubis-2.4.1/lib/erubis/evaluator.rb:6 | 2:inresult’
| [Mon May 05 17:42:06 2008] [error] mod_ruby: from
| /Users/yt/Sites/erubis/example3.rbx:15
| [Mon May 05 17:42:06 2008] [error] mod_ruby: from
| /opt/local/lib/ruby/1.8/apache/ruby-run.rb:53:in load' | [Mon May 05 17:42:06 2008] [error] mod_ruby: from | /opt/local/lib/ruby/1.8/apache/ruby-run.rb:53:inhandler’
|
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkgfZQEACgkQxFuRTtCTMvJTRACdGGfmyeoeRHHiAk/MkFwgR2e0
uNQAni3YL1Kk3AI6ejqUGASrKw8VE6iW
=6yQL
-----END PGP SIGNATURE-----

Tiago M. [email protected] wrote:

Honestly I don’t know what’s wrong, there is already a thread in
ruby-talk about the exact same issue with erubis and I’m not sure they
found a solution.

something in erubis is tainted, and i’m unable to untaint it, the reason
for the security error.

Tiago M. [email protected] wrote:

[email protected]:~# locate eruby.so
/usr/lib/ruby/1.8/i686-linux/eruby.so

nope, but i do have :
/opt/local/bin/eruby (*)

which i symlinked to :
/opt/local/apache2/cgi-bin/eruby

what sounds strange to me:
previously i had the same setup BUT, reinstalling eruby (same version
numbers) and re-doing the symlink make it working…

I’m running Mac OS X 10.4.11

and also :
/opt/local/include/eruby.h
/opt/local/lib/liberuby.a
/opt/local/lib/ruby/1.8/apache/eruby-debug.rb
/opt/local/lib/ruby/1.8/apache/eruby-run.rb
/opt/local/lib/ruby/1.8/powerpc-darwin8.8.0/eruby.bundle

This is what apache is requiring.

may be u don’t run the same OS ?

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs