-
Notifications
You must be signed in to change notification settings - Fork 29
Getting "Failed to run RuboCop command" with rbenv #2
Comments
Generally I thought I would already support rbenv (since I'm using it myself). But things are a little bit tricky in the OS X world. Could you help me by providing a few answers?
|
here are the answers
|
I'm having the same issue running .rbenv on a mac (ruby 2.1.4, 2.1.2, 2.1.5 for different projects). rubocop runs fine from command line. I did notice that error message says RuboCop and the filesystem says rubocop. Could this be a case sensitivity issue? I tried renaming the file from rubocop ot RuboCop and it did not help |
Could you install https://github.com/sirlantis/rubocop-for-rubymine/releases/tag/v1.0.1.rc1 and check whether this fixes the issue for you? Please note, that I changed another thing: The project MUST include a .rubocop.yml - otherwise the inspector won't run (had error messages all the time in projects where I don't use it). |
Sorry, wrong link - it's https://github.com/sirlantis/rubocop-for-rubymine/releases/tag/v1.0.1.rc1 (not 1.0.0.rc1). |
after i installed, it started working (i deliberately created a style violation and it highlighted immediately) but now it is no longer detecting violations and i see nothing in the event logs. I can see that rubocop has been added to the list of inspections. when i run inspections, they show up in the inspection list. it seems that if i close and reopen the project, i get the violations pointed in the file as tooltips. they disappear in real time as i fix them but they do not come back in real time though. is this the expected behavior? the inspection window behaves as i expect. the editor window sometimes highlights the errors but not reliably so and i do not understand under what conditions violations will be pointed out in the editor. this is still an excellent plugin for the rubocop inspections alone. having the errors pointed out in real time is incredible - unfortunately it behaves as i expect only some of the time. |
I've installed the updated plugin (1.0.1.rc1), also added an empty .rubocop.yml to the project root. But I still get this error:
The bundle command is created in shims here |
@richardwan RuboCop runs on the files that is saved to disk - if you have unsaved changes, the RuboCop annotations might be confusing. I guess that's the problem you've run in here. In an early prototype of the plugin I didn't use the files on the file-system but wrote the content of the current Document (saved or unsaved) to I added this issue as #3 - please continue discussion over there. |
@fifigyuri Ah, so you have a global RBENV_ROOT. The problem is that in IntelliJ is launched by My current strategy of using the SDK path and then finding the shim-folder next to it doesn't work because your I dug around and found JetBrains rake runner http://svn.jetbrains.org/teamcity/plugins/rake-runner/trunk/rake-runner-agent/ which has a bunch of files just for checking all the cases but by looking through the code I guess they wouldn't pick up your root. So I guess for it to work reliably we have to add a Settings panel and allow setting RBENV_ROOT over there. For the meantime you could add a symlink.
|
Thanks, the ice moved, now it found what it wanted.. Now it seems like rubocop has issue:
|
Is this followed by anything? The
|
That's the full error log I get:
|
Could you try to do the following
|
I've performed the steps. No OUTPUT/ERROR pair was found, but Rubocop error are in it. Take a look at the full log: https://www.dropbox.com/s/6p6h40b7xnioiey/idea.log?dl=0. |
Thanks for the log. The format of ERROR was a little bit different than I expected, but it's in the log.
|
You should be able to fix it by adding |
ah, yes, I've done already yesterday on different dev branch, forgot to add it back.. Sorry, for the confusion. It works now, but I still think though if it could be possible that the rubocop gem would be sufficient to have in the gemset for the ruby, not on project. Thank you very much for your help, that's wonderful tool. |
Yeah, I kind of agree. Or at least it the problem/solution could be more obvious. However I highly recommend adding RuboCop to the Gemfile (development group). We had some issues because everyone in the team was using a different one and RuboCop's config format changed a lot lately. |
Hi, thanks for putting this plugin together! I also ran into the error above regarding bundler and got past it using the v2.0.0.rc1 build. In the logs however I see: 2014-12-08 10:22:51,236 [ 393329] INFO - s.ruby.ruby.run.AbstractRunner - Executing [/Users/djantzen/.rbenv/versions/1.9.3-p547/lib/ruby/gems/1.9.1/gems/bundler-1.7.0/bin/bundle exec rubocop --format json /Users/djantzen/code/application/app/models/impact_zone.rb], working dir =[/Users/djantzen/code/application] Env: Rubocop runs from the command line, any idea what's failing when it runs from RubyMine? |
@djantzen Exit code 1 is also sent from RuboCop if it finds any violations. So if there's nothing else in your log file I would assume it runs fine. |
All right, looks like it's working. I appreciate the quick response! |
I tried to use the plugin. My rubies are managed by rbenv, rubycop is installed and getting this error messages:
Rubocop is at other place (
/usr/local/opt/rbenv/shims/rubocop
) than what the plugin expected.Do you support rbenv? I'm pretty much excited using the plugin, could you help me out? Thank you.
The text was updated successfully, but these errors were encountered: