Skip to content

Error '-s/--stdin requires exactly one path' #78

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
lucianghinda opened this issue Jun 2, 2018 · 7 comments
Open

Error '-s/--stdin requires exactly one path' #78

lucianghinda opened this issue Jun 2, 2018 · 7 comments

Comments

@lucianghinda
Copy link

lucianghinda commented Jun 2, 2018

Error stacktrace:

/Users/lucian/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rubocop-0.56.0/lib/rubocop/options.rb:29:inparse' /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
@anacarolinacastro
Copy link

Im having this same issue.

  • rubocop 0.58.2
  • ruby 2.3.0
  • macOS Sierra 10.12.6

@Mracobes9
Copy link

I have this problem too

@jameshibbard
Copy link

jameshibbard commented Jan 12, 2019

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:

gem 'rubocop', '~> 0.62.0', require: false

When I removed this line from the Gemfile and installed rubocop via:

gem install rubocop

The error went away.

@luciuschoi
Copy link

I have the following error:

-s/--stdin requires exactly one path, relative to the root of the project. RuboCop will use this path to determine which cops are enabled (via eg. Include/Exclude), and so that certain cops like Naming/FileName can be checked.

@vzamanillo
Copy link

Look for a .rubocop arguments file in your project directory and remove it, Rubocop does not allow the use of stdin in combination with an arguments file, alternatively you can put your configuration on a .rubocop.yml file.

@flipsasser
Copy link

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 was bundle 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.

@dziesig
Copy link

dziesig commented Mar 18, 2023

Thank you @flipsasser !!! I wasted four hours today when all I had to do was rename the root of my project from .../Rails Programs to .../RailsPrograms

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants