Android-Travis CI。无法使用travis login --pro命令登录

时间:2018-04-10 11:00:58

标签: rubygems travis-ci travis-ci-cli

我需要加密密钥库文件。我使用gem安装了travis。我无法使用我的github帐户登录travis。 travis已与github帐户链接。

Ruby:  Ruby 2.0.0-p645 
RubyGem : 2.4.8 
CLI : 1.8.8 


**Error:** 
 Last Exception
An error occurred running `travis login --pro`:
    TypeError: no implicit conversion of nil into String
        from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/json/common.rb:155:in `initialize'
        from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/json/common.rb:155:in `new'
        from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/json/common.rb:155:in `parse'
        from /Library/Ruby/Gems/2.0.0/gems/travis-1.8.8/lib/travis/tools/github.rb:262:in `gh_error'
        from /Library/Ruby/Gems/2.0.0/gems/travis-1.8.8/lib/travis/tools/github.rb:211:in `rescue in basic_auth'
        from /Library/Ruby/Gems/2.0.0/gems/travis-1.8.8/lib/travis/tools/github.rb:208:in `basic_auth'
        from /Library/Ruby/Gems/2.0.0/gems/travis-1.8.8/lib/travis/tools/github.rb:215:in `login'
        from /Library/Ruby/Gems/2.0.0/gems/travis-1.8.8/lib/travis/tools/github.rb:80:in `possible_tokens'
        from /Library/Ruby/Gems/2.0.0/gems/travis-1.8.8/lib/travis/tools/github.rb:49:in `each_token'
        from /Library/Ruby/Gems/2.0.0/gems/travis-1.8.8/lib/travis/tools/github.rb:36:in `with_token'
        from /Library/Ruby/Gems/2.0.0/gems/travis-1.8.8/lib/travis/cli/login.rb:31:in `login'
        from /Library/Ruby/Gems/2.0.0/gems/travis-1.8.8/lib/travis/cli/login.rb:40:in `run'
        from /Library/Ruby/Gems/2.0.0/gems/travis-1.8.8/lib/travis/cli/command.rb:198:in `execute'
        from /Library/Ruby/Gems/2.0.0/gems/travis-1.8.8/lib/travis/cli.rb:64:in `run'
        from /Library/Ruby/Gems/2.0.0/gems/travis-1.8.8/bin/travis:18:in `<top (required)>'
        from /usr/local/bin/travis:23:in `load'
        from /usr/local/bin/travis:23:in `<main>'

任何人都可以帮我解决这个问题。

由于

1 个答案:

答案 0 :(得分:0)

问题是Ruby不是最新的。我已经更新了它并且工作正常。

以下是要遵循的命令:

\curl -sSL https://get.rvm.io | bash -s stable --ruby

要安装最新的稳定版本,请使用以下命令:

rvm install ruby-2.4.2

安装travis:

sudo gem install travis -v 1.8.8 --no-rdoc --no-ri

现在我可以使用我的GitHub帐户登录Travis。