Error '-s/--stdin requires exactly one path'
See original GitHub issueError stacktrace:
/Users/lucian/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rubocop-0.56.0/lib/rubocop/options.rb:29:in
parse’ /Users/lucian/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rubocop-0.56.0/lib/rubocop/cli.rb:37:in run' /Users/lucian/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rubocop-0.56.0/bin/rubocop:13:in
block in <top (required)>’ /Users/lucian/.rbenv/versions/2.5.1/lib/ruby/2.5.0/benchmark.rb:308:in realtime' /Users/lucian/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rubocop-0.56.0/bin/rubocop:12:in
<top (required)>’ /Users/lucian/.rbenv/versions/2.5.1/bin/rubocop:23:in load' /Users/lucian/.rbenv/versions/2.5.1/bin/rubocop:23:in
<top (required)>’ /Users/lucian/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/bundler-1.16.1/lib/bundler/cli/exec.rb:75:in load' /Users/lucian/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/bundler-1.16.1/lib/bundler/cli/exec.rb:75:in
kernel_load’ /Users/lucian/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/ge…
`
My environment:
- Rbenv
- Ruby 2.5.1p57
- With Visual Studio Code: Version 1.24.0-insider (1.24.0-insider) and also with Visual Studio Code Version 1.23.1
- rubocop (0.56.0)
- OS: MacOS High Sierra, v 10.13.4
Issue Analytics
- State:
- Created 5 years ago
- Reactions:8
- Comments:6
The problem seems to be caused when you install rubocop using Bundler. Initially, (as per the instructions on the project’s homepage) I had the following in my
Gemfile
:When I removed this line from the
Gemfile
and installed rubocop via:The error went away.
I was getting the same error @luciuschoi mentioned.
In my case it was happening because I moved a project into an iCloud folder on MacOS. The full path had unescaped, special characters in it. It included a space (
) and some tildes (
~
) - the latter I realize is silly to have in a directory name at all, but just FYI. The full command wasbundle exec rubocop --stdin /Users/flip/Library/Mobile Documents/com~apple~CloudDocs/Clients/REDACTED/app/models/concerns/user_sync.rb --force-exclusion --auto-correct
.I resolved it simply by moving the project back out of my iCloud drive, but I thought this was worth mentioning.