首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Chef:无法加载这样的文件-- rubocop/formatter/checkstyle_formatter

Chef:无法加载这样的文件-- rubocop/formatter/checkstyle_formatter
EN

Stack Overflow用户
提问于 2015-04-15 02:44:29
回答 1查看 759关注 0票数 1

我正在运行以下命令:

代码语言:javascript
运行
复制
rubocop --require rubocop/formatter/checkstyle_formatter --format RuboCop::Formatter::CheckstyleFormatter --no-color --silent --rails --out checkstyle.xml

并得到这个错误:

代码语言:javascript
运行
复制
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:

代码语言:javascript
运行
复制
gem install rubocop-checkstyle_formatter

RuboCop (0.28.0)是在Chef-DK 0.4.0中提供的,没有Formater,它可以正常工作。

以下是格式器的页面:https://github.com/eitoball/rubocop-checkstyle_formatter

我没有找到任何解决方案,通过搜索谷歌或这里在stackoverflow。如何解决或分析问题有什么建议吗?我是新来Ruby的。

EN

回答 1

Stack Overflow用户

发布于 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文件。现在解决方案来了。

代码语言:javascript
运行
复制
touch checkstyle_formatter.rb

然后将https://github.com/eitoball/rubocop-checkstyle_formatter/blob/master/lib/rubocop/formatter/checkstyle_formatter.rb复制到您刚刚创建的文件中。

那你应该可以走了

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/29635079

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档