Can someone explain to me why I’m getting the error below for this part
of a script? It doesn’t seem to like line 24, the scan line, but, I’ve
got this same code being used for other needs and it doesn’t complain at
all there.
Can someone explain to me why I’m getting the error below for this part
of a script? It doesn’t seem to like line 24, the scan line, but, I’ve
got this same code being used for other needs and it doesn’t complain at
all there.
from indexpagecounts_6x9.rbw:24
from indexpagecounts_6x9.rbw:20:in `each’
from indexpagecounts_6x9.rbw:20
Exit code: 1
You’re modifying file_contents during scan, so scan gets confused.
from what I see, you’d better use gsub! with a block, since, if I
understood your point, you are basically inserting text where you detect
something.
You’re modifying file_contents during scan, so scan gets confused.
from what I see, you’d better use gsub! with a block, since, if I
understood your point, you are basically inserting text where you detect
something.
Vince
Thanks, Vince. I see what you mean, and, I did change it to use a gsub!.
I’ve always thought of gsub as a changer for little things, not huge
files like this, but, it works fine. Thanks again.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.