mod_ruby problem

  • Thread starter Sean C. Burbidge
  • Start date
S

Sean C. Burbidge

hi all,

mod_ruby WAS working; now it's not. here's the apache error:

"mod_ruby: error in ruby\n(eval):45: (eval):45: uninitialized constant
Apache::ERubyRun (NameError)\n\tfrom (eval):45:in `value'\n"

here are the relevant portions of my apache config:

LoadModule ruby_module /usr/lib/apache/mod_ruby.so
RubyRequire apache/ruby-run
RubyRequire apache/eruby-run
<Files *.rbx>
SetHandler ruby-object
RubyHandler Apache::RubyRun.instance
</Files>
<Files *.rbs>
SetHandler ruby-object
RubyHandler Apache::ERubyRun.instance
</Files>

this is a gentoo system:

mod_ruby 1.2.0
ruby 1.8.2_pre2
apache 1.3.31-r2

any and all help is greatly appreciated. i've re-emerged mod-ruby a
couple of times, weeded out unnecessary lines in config files, and
sacrificed a chicken - all to no avail. i've also checked the mailing
list archives, and everything *appears* to be setup correctly. i know
i'm missing something - i just can't find it.

thanks!
sean
 
K

Kent Sibilev

Have you reinstalled Ruby recently? The thing is that mod-ruby installs
its package into lib/ruby/1.8/ directory instead of
lib/ruby/site_ruby/1.8. So every time you reinstall Ruby you have to
reinstall mod_ruby as well.

Just a thought.

Cheers,
Kent.
 
S

Sean C. Burbidge

Kent said:
Have you reinstalled Ruby recently? The thing is that mod-ruby
installs its package into lib/ruby/1.8/ directory instead of
lib/ruby/site_ruby/1.8. So every time you reinstall Ruby you have to
reinstall mod_ruby as well.


i did emerge the latest ruby a couple of days ago. just restarted
apache today for some config changes to take effect, and that's when i
notied my mod-ruby setup was busted.

looking through the main apache error log, i just found this error:

"mod_ruby: failed to require apache/eruby-run"
"mod_ruby: error in ruby\n/usr/lib/ruby/1.8/apache/eruby-run.rb:45:in
`require': No such file to load -- eruby (LoadError)\n\tfrom
/usr/lib/ruby/1.8/apache/eruby-run.rb:45\n"

--- /usr/lib/ruby/1.8/apache/eruby-run.rb:45:
require "eruby"
---

i assume that it's looking for eruby.so, which is in
/usr/lib/ruby/1.8/i686-linux-gnu. i've symlinked to that file in
1.8/apache:

eruby.so -> /usr/lib/ruby/1.8/i686-linux-gnu/eruby.so

but still no joy. at this point i'm wondering if the mod-ruby ebuild is
wonky or if it's a problem with the .so being in a directory that's not
in the right path? symlinking 1.8/apache into site_ruby/1.8 doesn't
work either, but changes the error message in my apache error_log:

"error in ruby\n/usr/lib/ruby/site_ruby/1.8/apache/eruby-run.rb:45:in
`require': No such file to load -- eruby (LoadError)\n\tfrom
/usr/lib/ruby/site_ruby/1.8/apache/eruby-run.rb:45\n"

[ note path change from 1.8/ to site_ruby/1.8 ]

so it appears that require prefers site_ruby/1.8 over 1.8? but still no
explanation why the fatal on the require "eruby" statement on line 45 of
eruby-run.rb.

sean
 
S

Sean C. Burbidge

btw, i am able to get my scripts running by hardcoding the path to
eruby.so in eruby-run.rb. here's my (temporarily) edited eruby-run.rb

45: require "/usr/lib/ruby/1.8/i686-linux-gnu/eruby"

so this is a problem with the location of the .so. i'll start poking
around to find out where everything needs to go. :)

sean
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top