ruby URI:Module的未定义方法“escape”(NoMethodError)

hfyxw5xn  于 2023-08-04  发布在  Ruby
关注(0)|答案(1)|浏览(273)

当我运行这个命令时,出现了这个错误:

qppn@MacBook-Pro hello % motion support
/Library/RubyMotion/lib/motion/command.rb:140:in guess_email_address': undefined method escape' for URI:Module (NoMethodError)

      URI.escape(`git config --get user.email`.strip)
         ^^^^^^^
    from /Library/RubyMotion/lib/motion/command/support.rb:36:in `run'
    from /Library/RubyMotion/vendor/CLAide/lib/claide/command.rb:277:in `run'
    from /Library/RubyMotion/lib/motion/command.rb:106:in `run'
    from /usr/local/bin/motion:22:in `<main>'

字符串

k4emjkb1

k4emjkb11#

看起来应用程序在Ruby 3.0+上运行时试图调用URI.escapeURI.escapeRuby 2.7中被弃用,并从Ruby 3.0中删除。
要修复此问题,需要更新应用程序,或者需要使用Ruby 2.7运行应用程序。不推荐使用后者,因为Ruby 2.7将于2023年3月结束生命周期,并且未进行维护。

相关问题