Undefined method `escape' for URI:Module (NoMethodError)

320 Views Asked by At

When I run this command this error shows up:

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>'

1

There are 1 best solutions below

1
spickermann On

It looks like the application tries to call URI.escape while running on Ruby 3.0+. URI.escape was deprecated in Ruby 2.7 and removed from Ruby 3.0.

To fix this issue, the application needs to be updated, or the application needs to be run with Ruby 2.7. The latter is not recommended, because Ruby 2.7 reached end-of-life March 2023 and is unmaintained.