简体   繁体   English

在ExpandPathArguments上的rubocop错误

[英]rubocop error on ExpandPathArguments

I have this rubocop error 我有这个rubocop错误

Offenses:

fastlane-plugin-lizard.gemspec:1:12: C: Style/ExpandPathArguments: Use expand_path('lib', __dir__) instead of expand_path('../lib', __FILE__).
lib = File.expand_path("../lib", __FILE__)
           ^^^^^^^^^^^

10 files inspected, 1 offense detected
RuboCop failed!
Exited with code 1

How do I fix this error? 如何解决此错误? cos follow rubocop advise I will get another error cos跟着rubocop告诉我我会得到另一个错误

#!/bin/bash -eo pipefail
bundle check || bundle install --jobs=4 --retry=3 --path vendor/bundle

[!] There was an error parsing `Gemfile`: 
[!] There was an error while loading `fastlane-plugin-lizard.gemspec`: cannot load such file -- fastlane/plugin/lizard/version
Does it try to require a relative path? That's been removed in Ruby 1.9. Bundler cannot continue.

Change 更改

lib = File.expand_path("../lib", __FILE__)

to

lib = File.expand_path("lib", __dir__)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM