Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.ruby
require works in ruby not in eruby
Adam Hurlburt
10/13/2008 3:30:00 AM
Hello,
I am loading a .rb file from and .rhtml (using an absolute path)and the
rb file loads fine but then it requires another file (using relative
path) require 'sdl'. I am running apache2 and what is especially strange
is that if I run the url of the .rb file I am requiring in the brower
the server executes the script fine but when I load it from the .rhtml
file it gives me an error. I have printed the load path and it contains
the directory for the file sdl.rb and I have also tried 'sdl.rb' and it
does not work however it will load if I put the absolute path (require
'/path to file/sdl.rb). The problem with this besides being annoying is
that the file sdl.rb requires a bunch of other files using relative
paths. The problem seems to be that eruby which executes within the
rhtml file is not loading the same relative paths as ruby however if i
print $: in embedded ruby within the same .rhtml file it clearly states
the correct directoy the file is located in.
The following code is in the file ruby.conf which allows embedded ruby
on the server
<code>
AddType text/html .rhtml
<IfModule mod_ruby.c>
RubyRequire apache/ruby-run
RubyRequire apache/eruby-run
# Execute *.rbx files as Ruby scripts
<Files *.rbx>
SetHandler ruby-object
RubyHandler Apache::RubyRun.instance
</Files>
# Handle *.rhtml files as eRuby files
<Files *.rhtml>
SetHandler ruby-object
RubyHandler Apache::ERubyRun.instance
</Files>
</IfModule>
</code>
Ive spent hours looking through forums and posts and nothing helps
require 'rubygems' does nothing. I will be returning to this post
frequently in the next few days if you need me to post anymore
information just ask.
Any help is appreciated!!Thanks
--
Posted via
http://www.ruby-...
.
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
require works in ruby not in eruby
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password