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

Already on GitHub? Sign in to your account

Very slow starting with ft=ruby, have to ^C #77

cormacrelf opened this Issue Apr 21, 2012 · 9 comments


None yet
5 participants
"file.rb" [New File]^C
Command terminated
Error detected while processing /Users/cormac/dotfiles/vim/vim.symlink/bundle/vim-ruby/ftplugin/
line   82:
Error detected while processing /usr/share/vim/vim73/ftplugin/ruby.vim:
line    1:

It seems like there's some problem with the existing ruby files, but other than that, I have no idea what's happening. After hitting enter to continue, things look ok, until you get 8-width spaces and no snipMate snippets completing, amongst other oddities.

I installed vim-ruby using plain old git submodule add into Pathogen's bundle folder, nothing fancy.

My regular vim is VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Jul 31 2011 19:27:29) with:

-arabic +autocmd -balloon_eval -browse +builtin_terms +byte_offset +cindent -clientserver -clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments -conceal +cryptv +cscope +cursorbind +cursorshape +dialog_con +diff +digraphs -dnd -ebcdic -emacs_tags +eval +ex_extra +extra_search -farsi +file_in_path +find_in_path +float +folding -footer +fork() -gettext -hangul_input +iconv +insert_expand +jumplist -keymap -langmap +libcall +linebreak +lispindent +listcmds +localmap -lua +menu +mksession +modify_fname +mouse -mouseshape -mouse_dec -mouse_gpm -mouse_jsbterm -mouse_netterm -mouse_sysmouse +mouse_xterm +multi_byte +multi_lang -mzscheme +netbeans_intg -osfiletype +path_extra -perl +persistent_undo +postscript +printer -profile -python -python3 +quickfix +reltime -rightleft -ruby +scrollbind +signs +smartindent -sniff +startuptime +statusline -sun_workshop +syntax +tag_binary +tag_old_static -tag_any_white -tcl +terminfo +termresponse +textobjects +title -toolbar +user_commands +vertsplit +virtualedit +visual +visualextra +viminfo +vreplace +wildignore +wildmenu +windows +writebackup -X11 -xfontset -xim -xsmp -xterm_clipboard -xterm_save`.

This also happens in MacVim, but one is unable to Interrupt in MacVim, thus it isn't possible to cancel out.


tpope commented Apr 21, 2012

The backtrace leads us right to the line where ruby is invoked to determine the load path. Try

:echo system("ruby -e 'print $:.join(%q{,})'")

And see if it hangs the same way.

Nope, no hang. Just prints out this (with commas instead of these pretty newlines):


kostia commented Nov 2, 2012

Same issue. Vim hangs with 100% CPU when opening ruby files. After ^C getting error: in /Users/kostiaka/.vim/bundle/vim-ruby/ftplugin/ruby.vim on line 82.

kostia commented Nov 2, 2012

@tpope Following command also hangs:

:echo system("ruby -e 'print $:.join(%q{,})'")

tpope commented Nov 2, 2012

@kostia does it hang if you run ruby -e 'print $:.join(%q{,})' from your shell? How about if you :! it in Vim?

kostia commented Nov 2, 2012

@tpope I found the source of my problem: it was a misconfigured PATH, which led to an endless loop when determining ruby bin. Sorry for disturbance.

@kostia Can you pls tell how you fixed the PATH? I tried ruby -e 'print $:.join(%q{,})' from shell and it does not hang. But my Vim hangs even if I do :ruby 1 (as a test case to test the whether vim works file with ruby). What exactly is the cause?

More info
:echo system("ruby -e 'print $:.join(%q{,})'")
does not hang.

ruby 1.9.3p392 (2013-02-22 revision 39386)
VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Mar 17 2013 01:11:23)
-python3 +quickfix +reltime -rightleft +ruby +scrollbind +signs +smartindent


tpope commented Mar 17, 2013

Note that :ruby 1 uses the built-in if_ruby, which ftplugin/ruby.vim does not use. So there's a good chance your problem is unrelated.

@paramvir-b I don't know if it will help you, but I saw this same problem today when I had an unfortunate accident with my rvmrc file. I misremembered the command for creating an rvmrc file and rvm-auto-ruby was going into an infinite loop somehow. If you're using rvm, make sure that your rvm environment is a valid one https://rvm.io/workflow/rvmrc/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment