travis.rb icon indicating copy to clipboard operation
travis.rb copied to clipboard

undefined method `each_pair' for an instance of String

Open pasquale95 opened this issue 11 months ago • 0 comments

Hi, I'm trying to run the travis CLI on my macOS, but when I run the command travis logs I get the following error:

❯ travis logs  
/Users/test/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/gems/travis-1.14.0/lib/travis/cli/command.rb:334:in `format': wrong number of arguments (given 5, expected 1..3) (ArgumentError)
        from /Users/test/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/gems/travis-1.14.0/lib/travis/cli/command.rb:315:in `store_error'
        from /Users/test/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/gems/travis-1.14.0/lib/travis/cli/command.rb:235:in `rescue in execute'
        from /Users/test/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/gems/travis-1.14.0/lib/travis/cli/command.rb:200:in `execute'
        from /Users/test/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/gems/travis-1.14.0/lib/travis/cli.rb:66:in `run'
        from /Users/test/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/gems/travis-1.14.0/bin/travis:21:in `<top (required)>'
        from /Users/test/.asdf/installs/ruby/3.3.2/bin/travis:25:in `load'
        from /Users/test/.asdf/installs/ruby/3.3.2/bin/travis:25:in `<main>'
/Users/test/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/gems/travis-1.14.0/lib/travis/client/session.rb:149:in `load': undefined method `each_pair' for an instance of String (NoMethodError)

        (data || {}).each_pair do |key, value|
                    ^^^^^^^^^^
Did you mean?  each_char
        from /Users/test/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/gems/travis-1.14.0/lib/travis/client/session.rb:177:in `get'
        from /Users/test/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/gems/travis-1.14.0/lib/travis/client/session.rb:356:in `fetch_one'
        from /Users/test/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/gems/travis-1.14.0/lib/travis/client/session.rb:102:in `block in find_one'
        from /Users/test/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/gems/travis-1.14.0/lib/travis/client/session.rb:366:in `cached'
        from /Users/test/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/gems/travis-1.14.0/lib/travis/client/session.rb:102:in `find_one'
        from /Users/test/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/gems/travis-1.14.0/lib/travis/client/methods.rb:45:in `repo'
        from /Users/test/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/gems/travis-1.14.0/lib/travis/cli/repo_command.rb:37:in `repository'
        from /Users/test/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/gems/travis-1.14.0/lib/travis/cli/repo_command.rb:33:in `setup'
        from /Users/test/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/gems/travis-1.14.0/lib/travis/cli/logs.rb:21:in `setup'
        from /Users/test/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/gems/travis-1.14.0/lib/travis/cli/command.rb:207:in `execute'
        from /Users/test/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/gems/travis-1.14.0/lib/travis/cli.rb:66:in `run'
        from /Users/test/.asdf/installs/ruby/3.3.2/lib/ruby/gems/3.3.0/gems/travis-1.14.0/bin/travis:21:in `<top (required)>'
        from /Users/test/.asdf/installs/ruby/3.3.2/bin/travis:25:in `load'
        from /Users/test/.asdf/installs/ruby/3.3.2/bin/travis:25:in `<main>'

I've seen this error being mentioned in issues from 2020. Do you know the fix?

pasquale95 avatar Jan 22 '25 12:01 pasquale95