-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Rubocop doesn't show problems due to segfault #1467
Comments
Does this help? |
Hi, Thanks for the fast reply! I added the following to my .vimrc file (but I'm not using MacVim, just normal Vim installed through homebrew with
Now I see the error
If I run
If I then try
I notice that ruby 2.0.0p481 is listed (which isn't installed via rvm so must be the system ruby) so I guess the path is not correct or something? In my terminal the path is:
In Vim, I tried to see the path:
From this it looks like within Vim the rvm paths are listed after the system paths so I'm assuming it's using the wrong ruby? If I try to see which ruby is being used in Vim I get this (as expected):
As a test, I renamed the system ruby (temporality) to something else and tried again, this time I get an rvm path in Vim:
I tried opening the ruby file again in Vim, but got the same error above:
At this point I'm not really sure what I'm doing, sorry to be a pain. Any tips I can tryout? Thanks again Andy ❤️ 💙 💖 |
As you probably have already guessed, all this is between your shell, ruby, rubocop, and vim. It has nothing to do with syntastic. It's probably better to fix the problems, even though syntastic does offer some workarounds.
It's probably a better idea to run things under a shell that you did configure. That is, try to get the environment fixed in
Yup, that's what you need to fix. However, if you go the route of changing :echo syntastic#util#system('rubocop --version') Fixing
No, that doesn't make any sense. The :echo system('echo $PATH') or :echo syntastic#util#system('echo $PATH')
This is not really relevant, since the #!/usr/bin/ruby
Your MacVim, ruboop, and zsh are all conspiring to make this a pain in the rear (and, sadly, I'm only half joking). I'm not using any of those so the best I can do is point you to what other people claimed to have worked for them in the past. Sorry about that. Once you get either |
OK, no problem. Thanks for the feedback and I agree this isn't a syntastic issue but a setup one of my environment. I'll keep trying and will see what I can do. Thanks again 💖 |
For anyone else that might see this, I am currently running ruby 2.1.5 (via rvm). When I run this command in Vim:
I get the following output, so I guess the warning output from rubocop is messing things up when it comes to parsing the version number?:
So I installed ruby 2.1.6 with rvm, switched to it and installed rubocop for it. Now it's working fine. I removed the I'm not sure if syntastic should do something different if the reported version from rubocop is malformed, but that was the issue as far as I can see. I hope this is useful. |
Just make sure nothing is segfaulting under your feet.
That's a different issue (see this if you're curioous about the chain of blame). It's more or less addressed in the wiki. Sadly, |
Yeah, I saw that but when run from the terminal Anyway, thank you so much for your help. I'm loving using Syntastic already! 💖 |
In terminal you didn't have that problem because rvm worked. Should you have gotten it to also work in vim, you wouldn't have run into segfaults and you wouldn't have needed On the other hand, the other problem was |
So this is my workaround for now: /Users/me/nowarnrubocop.sh exec ruby -W0 -S rubocop "$@" /Users/me/.vimrc let g:syntastic_ruby_rubocop_exec = '/Users/me/nowarnrubocop.sh'
let g:syntastic_ruby_checkers = ['rubocop'] |
Hi,
Firstly I'm a bit of a Vim newbie so I might have done something wrong but I can't get rubocop to display issues in Vim even though it runs fine outside in the terminal. I've tried to get as much information as I can and I can see a segfault in the Syntastic debug log.
I am editing this project/branch in Vim: https://github.com/loyaltylion/nala/tree/syntax_errors and in particular the file: https://github.com/loyaltylion/nala/blob/syntax_errors/lib/nala/publisher.rb which has a syntax error.
Here is some information from my terminal (I use rvm):
This is my .vimrc config (snipped):
With debug set to 3, I see this output when I open
publisher.rb
in vim (snipped):If I run (what I assume is the correct command from the output) in my terminal, rubocop seems to work correctly:
So, I may well have done something odd and I'm happy to give you further information. What else can I provide that would help? I also tried with Ruby 2.1.5 and an older version of rubocop (0.28.0) as well as version 0.32.1 which had the same result.
Oh and here is my vim info (when using Ruby 2.1.5):
Thanks in advance.
Andy
💖
The text was updated successfully, but these errors were encountered: