在ruby-2.2.2上加密travis-ci的文件失败了,为“Psych:Module”调用了“私有方法`load”

时间:2015-06-28 22:35:02

标签: ruby ruby-on-rails-4 encryption travis-ci ruby-2.2

我在为Travis CI加密database.yml时遇到问题。基于他们的documentation, it appears you encrypt files with the travis encrypt-file command。我正在运行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>'

2 个答案:

答案 0 :(得分:0)

解决方案是卸载Psych版本2.0.13并在我的计算机上只有2.0.5。我同时拥有2.0.52.0.13,似乎彼此之间存在冲突。我在this forum post找到了相关信息。

答案 1 :(得分:0)

gem update --system

在Ubuntu 14.04 + RVM + Ruby 2.1.1p76上为我解决了这个问题,如下所述:https://github.com/bbatsov/rubocop/issues/1510#issuecomment-102645627