Syntax error from element.rb

Not a regular Ruby developer.
Rebuilding a Ruby environment after moving from Mandriva 2008.0 to
2009.1.

ruby 1.8.7 (2008-08-11 patchlevel 72) [i586-linux]
ruby-svg-1.0.2
I get the following error trace
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
gem_original_require': /usr/lib/ruby/site_ruby/1.8/svg/element.rb:423: syntax error, unexpected $undefined (SyntaxError) svg << %| textLength="#{@}"| if @length ^ /usr/lib/ruby/site_ruby/1.8/svg/element.rb:430: syntax error, unexpected kEND, expecting '}' from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:inrequire’
from /usr/lib/ruby/site_ruby/1.8/svg/svg.rb:9
from
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
gem_original_require' from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:inrequire’
from /home/graeme/Software/weather/devel/svgwind.rb:2

where svgwind.rb:2 says
require ‘svg/svg’

Version information:

$Id: element.rb,v 1.9 2002/11/12 11:32:40 rcn Exp $

Is this some sort of version compatibility issue? There was no such
problem under the previous environment.
Any help welcome.
Grimble

Grimble wrote:

                           ^

svg << %| textLength="#{@}"| if @length

isn’t legal Ruby. The @ can’t stand alone. It’s a prefix indicating an
instance variable, like “@length”. I don’t know why it wasn’t being
diagnosed before. It looks like an search-and-replace error of some
sort.

Grimble wrote:

Tim, thanks for a quick reply.
I checked back to the previous version:

$Id: element.rb,v 1.14 2003/02/06 14:59:43 yuya Exp $

The corresponding line was indeed:
svg << %| textLength="#{@length}"| if @length
So, I shall make the appropriate edit and retry.
Does this need to be reported as a bug?

I don’t see why not. The developer will probably thank you for it.

Tim H. wrote:

  svg << %| textLength="#{@}"|   if @length
                           ^

svg << %| textLength="#{@}"| if @length

isn’t legal Ruby. The @ can’t stand alone. It’s a prefix indicating an
instance variable, like “@length”. I don’t know why it wasn’t being
diagnosed before. It looks like an search-and-replace error of some sort.

Tim, thanks for a quick reply.
I checked back to the previous version:

$Id: element.rb,v 1.14 2003/02/06 14:59:43 yuya Exp $

The corresponding line was indeed:
svg << %| textLength="#{@length}"| if @length
So, I shall make the appropriate edit and retry.
Does this need to be reported as a bug?
Regards
Grimble

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs