From: Paul Lutus Date: 2006-11-25T20:15:06+09:00 Subject: Re: syntax error Une b辿vue wrote: > Paul Lutus wrote: > >> Show us the code that caused the error. It is obviously a real error, but >> it is difficult to sort out what it is from the message. > > here is part of the script down to the line giving an error (line 8) : > ----------------------------------------- > #!/usr/bin/env ruby -w > > if ARGV.length==1 > xml="" > found=false > root="" > file=ARGV[0] > fxml=file.gsub(/(.*)\.wav/,'\1.xml') # *** LINE 8 *** Okay. I successfully ran your code this way: file = "test.wav" fxml=file.gsub(/(.*)\.wav/,'\1.xml') puts fxml output: test.xml So there is nothing wrong with the syntax in the line creating the error message. I had hoped there was something important preceding the single code line you provided earlier, but this seems less likely now that I see it. / ... >> What is in RGV[0]? What is the content of the offending line? > > RGV[0] is a typo of mine, it should be read : > ARGV[0] Please do not retype your code into the newsreader. Instead, copy it directly from your programming editor. This may be the problem -- the code in your programming editor may not be identical to the code you have posted, because the code you posted runs fine. / ... >> But this is speculation without seeing the error line and its context. > > it was given in the preceeding message, even the line before . In your first post, you only provdied the single error line (no context). Now that I have seen the context and run a test I see there is nothing wrong with the code that produces the error message. But there are still the issues that (1) you apparently typed your code into the newsreader instead of copying it, and (2) you have three Ruby versions installed. If (1) the code you are running is identical to the code you posted, and (2) you are still getting the error message, then (3) you have to get rid of two of the three Ruby versions that are now living on your system. > both MacPort and SVN-jRuby ones are working and cohabit nicely. Except that your system will not execute perfectly good code, which means the three Ruby versions are not cohabiting nicely -- unless you are typing your code instead of copying it. -- Paul Lutus http://www.arachnoid.com