鞋子包装机问题
我使用打包程序为以下代码制作了可执行文件:
Shoes.app do
stack :margin => 10 do
@edit = edit_box :width => 1.0 do
@para.text = @edit.text
end
@para = para ""
end
end
然后收到错误消息:
Error in C:/Program Files/Common Files/Shoes/0.r1134/lib/shoes.rb line 394utf.rb: 10:
编译器错误
utf.rb: 10: 表达式中的无效字符“\377”
utf.rb: 10: 表达式中的字符“\337”无效
utf.rb: 10: 表达式中的字符“\337”无效
utf.rb: 10: 表达式中的字符“\331”无效
utf.rb: 10: 表达式中的无效字符“\377”
utf.rb: 10: 表达式中的字符“\270”无效
utf.rb:10:表达式中的字符'\ 304'无效
有人可以帮我吗?
BR,
多里安·G
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
可能是此处将文件保存在BOM中建议使用-less UTF-8。
Might be something here wherein saving the file in BOM-less UTF-8 is suggested.
我也遇到过类似的问题,但是以 Unix 格式保存使它对我有用。
不过,另一个问题似乎是打包的 .exe 以某种方式缓存了要执行的代码。 如果我更改源代码,运行打包程序来重新创建 exe,然后再次启动 exe,它似乎没有发生任何事情。 即使之前删除 .exe,或将源移动到另一个文件夹似乎也无法解决问题。
唯一的解决方案似乎是重命名源文件。 然后,打包程序会使用更新的代码正确创建一个新的 .exe。
有没有人遇到过这样的问题,或者知道解决方案? 是否可能有一个临时文件夹,打包程序在其中存储文件,然后无法覆盖该文件,以便始终使用“第一个版本”? 我查看了打包程序的源代码,但找不到任何东西......
Christian
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
我也找不到生成工作 .exe 的方法。 尝试以所有可能的 Unicode 编码变体保存源代码,但仍然一无所获。 鞋 r1134。 我想我在某个地方发红了,这个问题需要在期待已久的下一个鞋子版本中修复......
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 ...
我在 Windows 上使用 vim 时遇到了同样的问题。
我发现如果你使用记事本并将其保存为默认的“ANSI”,它确实有效
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"
我还收到“表达式中无效的字符'\377'”。 我保存为 UTF-8 (UNIX LF),所以这不是问题,这是因为我在应用程序名称中使用了下划线 ('_')。 显然你不能在名称中带有下划线的文件上使用 Shoes-packager,这很烦人,因为下划线是 ruby 约定......
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...