Problem with "require"

  • Thread starter Étienne Brouillard
  • Start date
É

Étienne Brouillard

Hi!

I'm begining with eRuby and I have a difficulty with a chunk of my code. I
have my index.rhtml wich contains a require, a .rb that is located in
Ressources/Ruby/RDForm.rb. When I run index.rhtml through eRuby, it goes
through perfectly fine but when I try to access it through Apache, I get
this error:


<-- Error -->
[Sat Oct 23 18:31:18 2004] [error] mod_ruby:
/home/http/godsiocorp/index.rhtml:8: uninitialized constant
#<Module:0x4120f22c>::RDForm (NameError)
[Sat Oct 23 18:31:18 2004] [error] mod_ruby: from (eval):117
[Sat Oct 23 18:31:18 2004] [error] mod_ruby: from
/usr/lib/ruby/1.8/apache/eruby-run.rb:116:in `eval_string_wrap'
[Sat Oct 23 18:31:18 2004] [error] mod_ruby: from
/usr/lib/ruby/1.8/apache/eruby-run.rb:116:in `run'
[Sat Oct 23 18:31:18 2004] [error] mod_ruby: from
/usr/lib/ruby/1.8/apache/eruby-run.rb:72:in `handler'

Here is the chunk in index.rhtml that causes some problems :

<-- index.rhtml -->
<%
#Requires
require 'Ressources/Ruby/RDForm'

#begin
form = RDForm.new("mainForm", "main", "POST", "index.rhtml")

%>

And RDForm.rb looks like that (in part)

<-- RDForm.rb -->
require 'Ressources/Ruby/RDIncludes.rb'

class RDForm

def initialize(m_id, m_name, m_method, m_action)
@id = m_id
@name = m_name
@method = m_method
@action = m_action
@hiddenFields = Array.new()
end

def id=(n_id)
@id = n_id
end

def name=(n_name)
@name = n_name
end

def method=(n_method)
@method = n_method
end

def action=(n_action)
@action = n_action
end
...

Apache 2, ruby 1.8.2, Gentoo Linux.

Many thanks in advance!

Étienne Brouillard
 

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,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top