Hey, does Eruby cache modules that you’re using, somehow? I’m
getting some very strange and very random behavior out of one of the modules
I wrote. I can refresh my page (.rhtml) 5 times in a row, and get three
different errors (including a parse error in my module) in my Apache log.
The only thing I can figure is that it seems to be using older saved
versions of my module as well as updated versions. I can run the page, make
a change in my module, and run the page again. I get the same error. Then
I run it a third time, and suddenly it’s fixed. I run it again, and I’ve
got the old error back again. Can someone help me out, please? If I’m not
giving enough info, I’ll be glad to answer any questions you may have about
my problem. It’s 2 am here, but I’ll be back later in the morning if you
all have questions for me.
If you’re using mod_ruby, all your scripts run in the same interpreter, so a
'require’d file only gets loaded once, unless you restart the web server.
During debugging, use ‘load’ instead.
Of course, this assumes that you’re using mod-ruby, if you’re using eruby from
something else I’m stuck.
Tim Bates
···
On Sun, 24 Nov 2002 06:43 pm, Stephen Neu wrote:
Hey, does Eruby cache modules that you’re using, somehow?
Hey, does Eruby cache modules that you're using, somehow? I'm
getting some very strange and very random behavior out of one of the modules
I wrote. I can refresh my page (.rhtml) 5 times in a row, and get three
different errors (including a parse error in my module) in my Apache log.
The only thing I can figure is that it seems to be using older saved
versions of my module as well as updated versions. I can run the page, make
a change in my module, and run the page again. I get the same error. Then
I run it a third time, and suddenly it’s fixed. I run it again, and I’ve
got the old error back again. Can someone help me out, please? If I’m not
giving enough info, I’ll be glad to answer any questions you may have about
my problem. It’s 2 am here, but I’ll be back later in the morning if you
all have questions for me.
Do you use eruby with mod_ruby?
If so, this is all quite expected behaviour.
Suggest you use load instead of require while developing.
···
–
([ Kent Dahl ]/)_ ~[ http://www.stud.ntnu.no/~kentda/ ]/~
))_student/(( _d L b_/ NTNU - graduate engineering - 5. year )
( __õ|õ// ) )Industrial economics and technological management(
_/ö____/ (_engineering.discipline=Computer::Technology)
getting some very strange and very random behavior out of one of the modules
I wrote. I can refresh my page (.rhtml) 5 times in a row, and get three
different errors (including a parse error in my module) in my Apache log.
The only thing I can figure is that it seems to be using older saved
versions of my module as well as updated versions. I can run the page, make
a change in my module, and run the page again. I get the same error. Then
I run it a third time, and suddenly it’s fixed. I run it again, and I’ve
got the old error back again. Can someone help me out, please? If I’m not
Do you use eruby with mod_ruby?
If so, this is all quite expected behaviour.
Suggest you use load instead of require while developing.
Mmm… I’m a beginner in mod_ruby, so why exactly is the above random behavior expected? (I experienced something very
similar, even using auto-reload.)
getting some very strange and very random behavior out of one of the modules
I wrote. I can refresh my page (.rhtml) 5 times in a row, and get three
different errors (including a parse error in my module) in my Apache log.
The only thing I can figure is that it seems to be using older saved
versions of my module as well as updated versions. I can run the page, make
a change in my module, and run the page again. I get the same error. Then
I run it a third time, and suddenly it’s fixed. I run it again, and I’ve
got the old error back again. Can someone help me out, please? If I’m not
Do you use eruby with mod_ruby?
If so, this is all quite expected behaviour.
Suggest you use load instead of require while developing.
Mmm… I’m a beginner in mod_ruby, so why exactly is the above random behavior expected?
I am no expert, but:
Apache usually runs more than one process for handling incoming
requests. In your httpd.conf you’ll find something like:
Number of servers to start initially — should be a reasonable
ballpark
figure.
···
StartServers 8
Each of these processes have their own Ruby interpreter embedded, since
you’re using mod_ruby. Each of these can therefore hold a different
current state as to what modules are loaded etc. When you browse to the
website, which process you end up with is fairly random. That means that
which version a require has resulted in will vary depending on which
process you’re assigned.
HTH
(I experienced something very
similar, even using auto-reload.)
I’m not sure what you mean by auto-reload, but if it is a thread-based
reloader that checks the timestamps of the files, I’d check
a) how often does it check for updates and
b) are the timestamps coming thru correctly.
(Personally, the last one reads like “check for clock drift between
workstation and server” :-P)
–
([ Kent Dahl ]/)_ ~[ http://www.stud.ntnu.no/~kentda/ ]/~
))_student/(( _d L b_/ NTNU - graduate engineering - 5. year )
( __õ|õ// ) )Industrial economics and technological management(
_/ö____/ (_engineering.discipline=Computer::Technology)