我正在运行以下命令:
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_formatterRuboCop (0.28.0)是在Chef-DK 0.4.0中提供的,没有Formater,它可以正常工作。
以下是格式器的页面:https://github.com/eitoball/rubocop-checkstyle_formatter
我没有找到任何解决方案,通过搜索谷歌或这里在stackoverflow。如何解决或分析问题有什么建议吗?我是新来Ruby的。
发布于 2015-10-06 01:52:03
我以一种相对粗糙的方式解决了这个问题,但它是有效的。所以基本上cd进入你的rubocop文件夹(如/home/ec2-user/.rvm/gems/ruby-2.1.2/gems/rubocop-0.34.2/lib/rubocop),,然后你会看到一个名为formatter的目录,然后cd进入格式化程序文件夹,你会看到一堆不同格式化程序的.rb文件。现在解决方案来了。
touch checkstyle_formatter.rb然后将https://github.com/eitoball/rubocop-checkstyle_formatter/blob/master/lib/rubocop/formatter/checkstyle_formatter.rb复制到您刚刚创建的文件中。
那你应该可以走了
https://stackoverflow.com/questions/29635079
复制相似问题