在 ruby-2.2.2 上为 travis-ci 加密文件失败,“为 Psych:Module 调用了私有方法‘load’" [英] Encrypting files for travis-ci on ruby-2.2.2 fails with "private method `load' called for Psych:Module"
问题描述
我在为 Travis CI 加密我的 database.yml
时遇到问题.根据他们的文档,您似乎使用 travis encrypt-file 命令加密文件.我在 Ruby-2.2.2 上运行,它给了我一些非常神秘的错误消息.
I'm having trouble encrypting my database.yml
for Travis CI. Based on their documentation, it appears you encrypt files with the travis encrypt-file command. I'm running on Ruby-2.2.2 and it's giving me some pretty cryptic error messages.
travis encrypt-file config/database.yml --add
我收到此错误:
private method `load' called for Psych:Module
for a full error report, run travis report
这是我运行 travis report
时的回溯:
Here's the backtrace when I run 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>'
推荐答案
解决方案是卸载 Psych
版本 2.0.13
并且只有 2.0.5
在我的机器上.我有 2.0.5
和 2.0.13
并且它们似乎相互冲突.我在这个论坛帖子上找到了信息.
The solution was to uninstall Psych
version 2.0.13
and have only 2.0.5
on my machine. I had both 2.0.5
and 2.0.13
and it seems that they were conflicting with each other. I found the information on this forum post.
这篇关于在 ruby-2.2.2 上为 travis-ci 加密文件失败,“为 Psych:Module 调用了私有方法‘load’"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!