[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

FXRuby & erb -- problems together?

djlewis

2/21/2009 2:18:00 AM


I'm having vexing problems with some erb templates I use to generate html.
The templates used to work just great in a gui-less program. But when I
embedded the template generation code inside a FXRuby interface, it started
giving random mysterious, intermittent errors during actual generation, the
outf.write statement...

template = ERB.new( IO.read( proto_company_index))
out_file = out_folder + @company + " indx.html"
outf = File.new( out_file, "w")
outf.write( template.result(binding))

I disabled the FXRuby interface entirely and drove it programmatically
through exactly the same code, and it goes back to working fine. So, it's
only circumstantial evidence, but it looks like erb and FXRuby are not
getting along, generating random errors in erb.

Anybody else run into this?

Here are three (different) errors from three different runs of exactly the
same code with FXruby going. So you see how random it is. (And these errors
do not arise when FXRuby is out of the picture.)

> Uncaught exception: compile error
> (erb):19: syntax error, unexpected tSTRING_BEG, expecting $end

> Uncaught exception: compile error
> (erb):18: syntax error, unexpected tIDENTIFIER, expecting $end

> Uncaught exception: compile error
> (erb):18: Invalid char `\250' in expression
> (erb):19: syntax error, unexpected tCONSTANT, expecting $end

I'd show you the erb template, but trust me, there's nothing near those
lines that could cause this.

PS: Other than perhaps not working together, FXRuby and erb are each great
on their own!
--
View this message in context: http://www.nabble.com/FXRuby---erb----problems-together--tp22132035p221...
Sent from the ruby-talk mailing list archive at Nabble.com.


1 Answer

djlewis

2/21/2009 6:47:00 PM

0


I switched to Erubis (in place of erb -- need to change only the class name
and it works just fine.) So it looks like erb and FXRuby are indeed
incompatible.

--David


djlewis wrote:
>
> I'm having vexing problems with some erb templates I use to generate html.
> The templates used to work just great in a gui-less program. But when I
> embedded the template generation code inside a FXRuby interface, it
> started giving random mysterious, intermittent errors during actual
> generation...
>

--
View this message in context: http://www.nabble.com/FXRuby---erb----problems-together--tp22132035p221...
Sent from the ruby-talk mailing list archive at Nabble.com.