问题
I used packager to make an executable file for the following code:
Shoes.app do
stack :margin => 10 do
@edit = edit_box :width => 1.0 do
@para.text = @edit.text
end
@para = para ""
end
end
then I got error message:
Error in C:/Program Files/Common Files/Shoes/0.r1134/lib/shoes.rb line 394utf.rb: 10:
compiler error
utf.rb: 10: Invalid char '\377' in expression
utf.rb: 10: Invalid char '\337' in expression
utf.rb: 10: Invalid char '\337' in expression
utf.rb: 10: Invalid char '\331' in expression
utf.rb: 10: Invalid char '\377' in expression
utf.rb: 10: Invalid char '\270' in expression
utf.rb: 10: Invalid char '\304' in expression
Could someone give me a hand?
BR,
DorianG
回答1:
Might be something here wherein saving the file in BOM-less UTF-8 is suggested.
回答2:
I had similar problems, but saving in Unix format made it work for me.
Though, another problem seems to be that the packaged .exe somehow caches the code to execute. If I change the source code, run packager to recreate the exe, and then starts the exe again, nothing seems to have happened to it. Even deleting the .exe before, or moving the source to another folder doesn't seem to solve the problem.
The only solution seems to be to rename the source file. The packager then correctly creates a new .exe with the updated code.
Has anyone had problems like this, or know of a solution? Is there perhaps a temp folder where the packager stores files, which then can't be overwritten so that the "first version" is always used? I've looked into the source code of the packager, but couldn't find anything there...
Christian
回答3:
I couldn't find a way to produce a working .exe too. Tried saving the source in all possible Unicode encoding variations but still nothing. Shoes r1134. I think I red somewhere this needs to be fixed in the already long awaited next Shoes release ...
回答4:
I had the same issue when using vim on windows.
I found that it does work if you use notepad and save it as the default "ANSI"
回答5:
I'm also getting "Invalid char '\377' in expression". I'm saving as UTF-8 (UNIX LF) so that's not the problem, it's because I'm using underscore ('_') in my app-names. Apparently you can't use the shoes-packager on files with underscore in the name which is annoying as underscore is the ruby-convention...
来源:https://stackoverflow.com/questions/363218/shoes-packager-problem