【发布时间】:2015-04-14 18:44:28
【问题描述】:
我正在运行以下命令:
rubocop --require rubocop/formatter/checkstyle_formatter --format RuboCop::Formatter::CheckstyleFormatter --no-color --silent --rails --out checkstyle.xml
并得到这个错误:
C:/opscode/chefdk/embedded/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- rubocop/formatter/checkstyle_formatter (LoadError)
环境是 Windows 上的 Chef-DK 0.4.0。我已经安装了 gem:
gem install rubocop-checkstyle_formatter
RuboCop (0.28.0) 在 Chef-DK 0.4.0 中交付,并且在没有 Formater 的情况下它可以工作。
这是Formater的页面:https://github.com/eitoball/rubocop-checkstyle_formatter
我没有通过谷歌搜索或在 stackoverflow 中找到任何解决方案。 任何提示如何解决或分析问题?我是 Ruby 新手。
【问题讨论】:
-
真的很奇怪。我尝试了几件事: - 设置、更改和删除 GEM_PATH、GEM_HOME 等。没有任何帮助。 Ruby 没有找到格式化程序。然后我卸载了 Chef-DK 并清理了所有环境变量。全新安装后,它工作正常。它会找到以前安装的 gem。
标签: ruby chef-infra rubocop