Skip to content
This repository has been archived by the owner on Dec 13, 2020. It is now read-only.

Failed to run RuboCop command - is it (or bundler) installed? #31

Closed
maia opened this issue Dec 22, 2015 · 6 comments
Closed

Failed to run RuboCop command - is it (or bundler) installed? #31

maia opened this issue Dec 22, 2015 · 6 comments

Comments

@maia
Copy link

maia commented Dec 22, 2015

I'm having problems getting rubocop-for-rubymine (version 3.0.2) to work, here is the error message:

Failed to run RuboCop command - is it (or bundler) installed? (SDK=/Users/username/.rbenv/versions/2.2.4/bin): Cannot run program "rubocop" (in directory "/Users/username/appname"): error=2, No such file or directory
com.intellij.execution.process.ProcessNotCreatedException: Cannot run program "rubocop" (in directory "/Users/username/appname"): error=2, No such file or directory
    at com.intellij.execution.configurations.GeneralCommandLine.createProcess(GeneralCommandLine.java:358)
    at org.jetbrains.plugins.ruby.ruby.run.RubyCommandLine.createProcess(RubyCommandLine.java:64)
    at io.github.sirlantis.rubymine.rubocop.RubocopTask$runViaCommandLine$1.invoke(RubocopTask.kt:190)
    at io.github.sirlantis.rubymine.rubocop.RubocopTask$runViaCommandLine$1.invoke(RubocopTask.kt:25)
    …

The error message is somewhat unclear as I can run rubocop in the referenced directory without any problem.

$ which rubocop
/Users/username/.rbenv/shims/rubocop

$ which bundler
/Users/username/.rbenv/shims/bundler

$ rbenv versions
  system
* 2.2.4 (set by /Users/username/.rbenv/version)

My Gemfile development group includes gem 'rubocop', /Users/username/.rbenv/versions/2.2.4/bin contains bundler (version 1.11.2), and my project root has a .rubocop.yml. Rubymine version is 8.0.2, OSX version is 10.11.2. Rubocop runs fine from the command line, but it leaves a warning (see below), which seems unlikely to be the cause?

$ rubocop
warning: parser/current is loading parser/ruby22, which recognizes
warning: 2.2.3-compliant syntax, but you are running 2.2.4.
warning: please see https://github.com/whitequark/parser#compatibility-with-ruby-mri.
@hms
Copy link

hms commented Dec 23, 2015

Bump.

Same thing here. I've played with linking rubocop in various places to see if I could narrow down the issue without luck

@shingo-nakanishi
Copy link

I use the rvm.

I update ruby version 2.2.3 to 2.2.4.
I got the same error for the rvm.

10:54:14 AM ProcessNotCreatedException: Failed to run RuboCop command - is it (or bundler) installed? (SDK=/Users/shingo/.rvm/rubies/ruby-2.2.4/bin): Cannot run program "rubocop" (in directory "/Users/shingo/Documents/myproject"): error=2, No such file or directory
10:54:15 AM ProcessNotCreatedException: Failed to run RuboCop command - is it (or bundler) installed? (SDK=/Users/shingo/.rvm/rubies/ruby-2.2.4/bin): Cannot run program "rubocop" (in directory "/Users/shingo/Documents/myproject"): error=2, No such file or directory
10:54:16 AM ProcessNotCreatedException: Failed to run RuboCop command - is it (or bundler) installed? (SDK=/Users/shingo/.rvm/rubies/ruby-2.2.4/bin): Cannot run program "rubocop" (in directory "/Users/shingo/Documents/myproject"): error=2, No such file or directory

Rubocop runs fine from the command line, but it leaves a warning (see below)

Me too.

% bundle exec rubocop
% rubocop

Rubocop runs fine from the both command line, but it leaves a warning.
Rubocop runs not work from this plugin.

@mrcljx
Copy link
Owner

mrcljx commented Dec 24, 2015

Please follow the steps in https://github.com/sirlantis/rubocop-for-rubymine/blob/master/CONTRIBUTING.md to provide more information on the issue.

@maia
Copy link
Author

maia commented Dec 24, 2015

Here's what I found in my idea.log after enabling debug:

2015-12-24 17:20:15,562 [   5332]   INFO - llij.ide.plugins.PluginManager - Loaded custom plugins: RuboCop (3.0.1) 
...
2015-12-24 17:20:18,094 [   7864]   INFO - lij.diagnostic.DebugLogManager - Set DEBUG for the following categories: [io.github.sirlantis.rubymine, io.github.sirlantis.rubymine.rubocop] 
...
2015-12-24 17:21:01,534 [  51304]  DEBUG - hub.sirlantis.rubymine.rubocop - Executing RuboCop (SDK=/Users/username/.rbenv/versions/2.2.4/bin, Bundler=true)rubocop --format json /Users/username/appname/app/controllers/urls_controller.rb 
2015-12-24 17:21:01,535 [  51305]   INFO - .ruby.ruby.run.RubyCommandLine - Executing [rubocop --format json /Users/username/appname/app/controllers/urls_controller.rb], working dir =[/Users/username/appname] 
2015-12-24 17:21:01,542 [  51312]   INFO - figurations.GeneralCommandLine - Cannot run program "rubocop" (in directory "/Users/username/appname"): error=2, No such file or directory 
java.io.IOException: Cannot run program "rubocop" (in directory "/Users/username/appname"): error=2, No such file or directory
  at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
  at com.intellij.execution.configurations.GeneralCommandLine.startProcess(GeneralCommandLine.java:368)
  at com.intellij.execution.configurations.GeneralCommandLine.createProcess(GeneralCommandLine.java:354)
  at org.jetbrains.plugins.ruby.ruby.run.RubyCommandLine.createProcess(RubyCommandLine.java:64)
  at io.github.sirlantis.rubymine.rubocop.RubocopTask$runViaCommandLine$1.invoke(RubocopTask.kt:190)
  at io.github.sirlantis.rubymine.rubocop.RubocopTask$runViaCommandLine$1.invoke(RubocopTask.kt:25)
  at io.github.sirlantis.rubymine.rubocop.RubocopTask.parseProcessOutput(RubocopTask.kt:67)
  at io.github.sirlantis.rubymine.rubocop.RubocopTask.runViaCommandLine(RubocopTask.kt:190)
  at io.github.sirlantis.rubymine.rubocop.RubocopTask.run(RubocopTask.kt:60)
  at io.github.sirlantis.rubymine.rubocop.RubocopAnnotator.doAnnotate(RubocopAnnotator.kt:157)
  at io.github.sirlantis.rubymine.rubocop.RubocopAnnotator.doAnnotate(RubocopAnnotator.kt:24)
  at com.intellij.codeInsight.daemon.impl.ExternalToolPass.d(ExternalToolPass.java:218)
...
2015-12-24 17:21:01,547 [  51317]   WARN - hub.sirlantis.rubymine.rubocop - Failed to run RuboCop command 
com.intellij.execution.process.ProcessNotCreatedException: Cannot run program "rubocop" (in directory "/Users/username/appname"): error=2, No such file or directory
  at com.intellij.execution.configurations.GeneralCommandLine.createProcess(GeneralCommandLine.java:358)
  at org.jetbrains.plugins.ruby.ruby.run.RubyCommandLine.createProcess(RubyCommandLine.java:64)
  at io.github.sirlantis.rubymine.rubocop.RubocopTask$runViaCommandLine$1.invoke(RubocopTask.kt:190)
  at io.github.sirlantis.rubymine.rubocop.RubocopTask$runViaCommandLine$1.invoke(RubocopTask.kt:25)
  at io.github.sirlantis.rubymine.rubocop.RubocopTask.parseProcessOutput(RubocopTask.kt:67)
  at io.github.sirlantis.rubymine.rubocop.RubocopTask.runViaCommandLine(RubocopTask.kt:190)
  at io.github.sirlantis.rubymine.rubocop.RubocopTask.run(RubocopTask.kt:60)
  at io.github.sirlantis.rubymine.rubocop.RubocopAnnotator.doAnnotate(RubocopAnnotator.kt:157)
  at io.github.sirlantis.rubymine.rubocop.RubocopAnnotator.doAnnotate(RubocopAnnotator.kt:24)
  at com.intellij.codeInsight.daemon.impl.ExternalToolPass.d(ExternalToolPass.java:218)
...
Caused by: java.io.IOException: Cannot run program "rubocop" (in directory "/Users/username/appname"): error=2, No such file or directory
  at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
  at com.intellij.execution.configurations.GeneralCommandLine.startProcess(GeneralCommandLine.java:368)
  at com.intellij.execution.configurations.GeneralCommandLine.createProcess(GeneralCommandLine.java:354)
  ... 37 more
Caused by: java.io.IOException: error=2, No such file or directory
  at java.lang.UNIXProcess.forkAndExec(Native Method)
  at java.lang.UNIXProcess.<init>(UNIXProcess.java:248)
  at java.lang.ProcessImpl.start(ProcessImpl.java:134)
  at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
  ... 39 more
2015-12-24 17:21:01,549 [  51319]  ERROR - hub.sirlantis.rubymine.rubocop - Failed to run RuboCop command - is it (or bundler) installed? (SDK=/Users/username/.rbenv/versions/2.2.4/bin) 
com.intellij.execution.process.ProcessNotCreatedException: Cannot run program "rubocop" (in directory "/Users/username/appname"): error=2, No such file or directory
  at com.intellij.execution.configurations.GeneralCommandLine.createProcess(GeneralCommandLine.java:358)
  at org.jetbrains.plugins.ruby.ruby.run.RubyCommandLine.createProcess(RubyCommandLine.java:64)
  at io.github.sirlantis.rubymine.rubocop.RubocopTask$runViaCommandLine$1.invoke(RubocopTask.kt:190)
  at io.github.sirlantis.rubymine.rubocop.RubocopTask$runViaCommandLine$1.invoke(RubocopTask.kt:25)
  at io.github.sirlantis.rubymine.rubocop.RubocopTask.parseProcessOutput(RubocopTask.kt:67)
  at io.github.sirlantis.rubymine.rubocop.RubocopTask.runViaCommandLine(RubocopTask.kt:190)
  at io.github.sirlantis.rubymine.rubocop.RubocopTask.run(RubocopTask.kt:60)
  at io.github.sirlantis.rubymine.rubocop.RubocopAnnotator.doAnnotate(RubocopAnnotator.kt:157)
  at io.github.sirlantis.rubymine.rubocop.RubocopAnnotator.doAnnotate(RubocopAnnotator.kt:24)
  at com.intellij.codeInsight.daemon.impl.ExternalToolPass.d(ExternalToolPass.java:218)
...
Caused by: java.io.IOException: Cannot run program "rubocop" (in directory "/Users/username/appname"): error=2, No such file or directory
  at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
  at com.intellij.execution.configurations.GeneralCommandLine.startProcess(GeneralCommandLine.java:368)
  at com.intellij.execution.configurations.GeneralCommandLine.createProcess(GeneralCommandLine.java:354)
  ... 37 more
Caused by: java.io.IOException: error=2, No such file or directory
  at java.lang.UNIXProcess.forkAndExec(Native Method)
  at java.lang.UNIXProcess.<init>(UNIXProcess.java:248)
  at java.lang.ProcessImpl.start(ProcessImpl.java:134)
  at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
  ... 39 more

@mrcljx
Copy link
Owner

mrcljx commented Dec 25, 2015

Hi everyone, I just pushed 3.1.0 to JetBrains plugin registry which delegates everything to RubyMine's internal handling of Gems/Bundler/RVM/rbenv (found some new APIs in RubyMine 8 which weren't there before). Please create a new issue if the problem persists.

@maia
Copy link
Author

maia commented Dec 25, 2015

Unfortunately the problem is not solved for me with 3.1.0. I've opened issue #33 .

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

No branches or pull requests

4 participants