加密对红宝石2.2.2特拉维斯-CI文件失败,并“呼吁精极度紧张私有方法`负载”:模块”(Encry

2019-10-23 13:40发布

我无法加密我database.yml特拉维斯- CI。 根据他们的资料,看来你与特拉维斯加密文件命令加密文件 。 我对Ruby的2.2.2运行,它给了我一些很神秘的错误消息。

travis encrypt-file config/database.yml --add

而我得到这个错误:

private method `load' called for Psych:Module
for a full error report, run travis report

下面是当我运行回溯travis report

$ travis report 

/Users/William.Jeffries/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/travis-1.7.7/lib/travis/cli/api_command.rb:150:in `default_endpoint': undefined method `[]' for nil:NilClass (NoMethodError)
        from /Users/William.Jeffries/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/travis-1.7.7/lib/travis/cli/api_command.rb:154:in `detected_endpoint'
        from /Users/William.Jeffries/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/travis-1.7.7/lib/travis/cli/api_command.rb:70:in `detected_endpoint?'
        from /Users/William.Jeffries/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/travis-1.7.7/lib/travis/cli/api_command.rb:158:in `endpoint_option'
        from /Users/William.Jeffries/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/travis-1.7.7/lib/travis/cli/command.rb:213:in `rescue in execute'
        from /Users/William.Jeffries/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/travis-1.7.7/lib/travis/cli/command.rb:191:in `execute'
        from /Users/William.Jeffries/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/travis-1.7.7/lib/travis/cli.rb:64:in `run'
        from /Users/William.Jeffries/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/travis-1.7.7/bin/travis:18:in `<top (required)>'
        from /Users/William.Jeffries/.rbenv/versions/2.2.2/bin/travis:23:in `load'
        from /Users/William.Jeffries/.rbenv/versions/2.2.2/bin/travis:23:in `<main>'

Answer 1:

解决的办法是卸载Psych版本2.0.13和只有2.0.5我的机器上。 我有两个2.0.52.0.13 ,似乎他们是相互冲突的。 我发现在信息这个论坛的帖子 。



Answer 2:

gem update --system

解决了这个问题,我在Ubuntu 14.04 + RVM +红宝石2.1.1p76截至提到: https://github.com/bbatsov/rubocop/issues/1510#issuecomment-102645627



文章来源: Encrypting files for travis-ci on ruby-2.2.2 fails with “private method `load' called for Psych:Module”