【环境信息】
系统:arrch64,x86_64虚拟机
内存:4g
OS版本:openEuler_22.03_LTS-round-1
【问题复现步骤】
1.安装rubygem-rdoc包,准备一个main.rb文件
2.执行rdoc main.rb --template-stylesheets=main.rb | grep "Parsing sources"
【预期结果】
执行成功无报错,doc下面生成main.rb
【实际结果】
执行报错,doc下面没有生成main.rb
Hi guojuanjuan, welcome to the openEuler Community.
I'm the Bot here serving you. You can find the instructions on how to interact with me at Here.
If you have any questions, please contact the SIG: sig-ruby, and any of the maintainers: @木得感情的openEuler机器人 , @small_leek , @huanghaitao
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。
rdoc main.rb --template-stylesheets=main.rb --debug可以查看报错堆栈
合入补丁:https://github.com/ruby/ruby/commit/76c7388c1f41fb0ae3dacda0d9c02e7562a6655d
之后报错:no implicit conversion of Array into String
File.path的输入参数s的类型是Array,可以在传入File.path之前调用puts s.class查看s的类型:
下载安装ruby-2.5.8版本的rdoc安装测试,可以发现File.path的输入参数s的类型是String.
测试可以发现,src、tmp都是Array,File.path的输入参数s应该是String
ruby 3.1.1正常
ruby 3.0.3:
详细如下:
回合https://github.com/ruby/ruby/commit/76c7388c1f41fb0ae3dacda0d9c02e7562a6655d 之后:
回合https://github.com/ruby/ruby/commit/76c7388c1f41fb0ae3dacda0d9c02e7562a6655d 补丁即可修复,出现上面合入后测试未修复的原因是当时测试时直接修改本机中的/usr/share/gems/gems/rdoc-6.3.3/lib/rdoc/generator/darkfish.rb文件,然后验证,未经过重编。现只合入该补丁,重新构建出二进制,安装之后问题就消失了。
验证版本:22.03
验证结果:通过
登录 后才可以发表评论