Installing vim with ruby support (+ruby)

后端 未结 13 2029
萌比男神i
萌比男神i 2020-12-04 07:37

I\'m trying to get command-t installed for vim but my current version of vim doesn\'t have the (+ruby) flag. The command \"which ruby\" shows that ruby is installed.

相关标签:
13条回答
  • 2020-12-04 07:42

    It looks like you need to have ruby installed before install vim-nox.

    This works for me on Ubuntu 18.10

    sudo apt-get install ruby rubygems vim-nox

    Source: https://junegunn.kr/2013/09/installing-vim-with-ruby-support

    0 讨论(0)
  • 2020-12-04 07:44

    Some package provides vim-ruby on Ubuntu, for example vim-nox.

    simply:

    sudo apt-get install vim-nox;
    

    will get you vim with ruby, as well as compiled in "support for scripting with Perl, Python, Ruby, and TCL but no GUI."

    sudo apt-get install vim-rails
    

    will install a "selection of vimscripts that make editing Ruby on Rails applications extremely easy." but as it depends on vim-full and vim-addon-manager, it will also install the vim-gnome version of the GUI, that is "a version of vim compiled with a GNOME2 GUI and support for scripting with Perl, Python, Ruby, and TCL."

    0 讨论(0)
  • 2020-12-04 07:44

    On mac os x, assuming you have Homebrew installed:

    brew install https://raw.github.com/Homebrew/homebrew-dupes/master/vim.rb
    

    This version of vim has ruby support enabled

    Source: http://blog.jerodsanto.net/2011/08/brew-install-vim/

    EDIT: edited the url, thanks @david-xia for mentioning the change

    UPDATE: Apparently, homebrew vim now comes with ruby support enabled by default so you just need to do brew install vim (see comment below)

    0 讨论(0)
  • 2020-12-04 07:44

    If you are lazzy and don't want to recompile you can try to find a package with a vim version including ruby. On debian it's vim-ruby so something like

    apt-get install vim-ruby 
    

    might work. (I can't try it, I m on mac. On mac , MacVim come with ruby enabled)

    0 讨论(0)
  • 2020-12-04 07:46

    I think "Compiling Vim With Ruby Integration On Snow Leopard" might actually help. I'm on exactly same boat at the moment.


    Ok... got it to work. Took me like half hour or so.

    This should help (I got Ubuntu):

    sudo apt-get install mercurial
    hg clone https://vim.googlecode.com/hg/ vim
    cd vim
    ./configure --enable-rubyinterp
    make
    sudo make install
    

    To test if things look fancy:

    vim --version | grep ruby
    

    Should return something like:

    -python3 +quickfix +reltime -rightleft +ruby +scrollbind +signs +smartindent
    

    Ruby should have plus now. Another trick to test it - enter vim and hit :ruby 1. Should not fail.

    0 讨论(0)
  • 2020-12-04 07:48

    On Mac OS X, I find that the easiest is to install MacVim with brew install macvim which includes +ruby. And then symlink /usr/local/bin/vim to /usr/local/bin/mvim. That way to get a recent Vim version, with the huge feature set, +ruby, both GUI and command line vim just using the standard HomeBrew repository. No need for external repository like in Pierre answer

    To avoid issues it's better to use the use the system ruby during installation so:

    rvm use system
    brew install macvim
    ln -s /usr/local/bin/mvim /usr/local/bin/vim
    
    0 讨论(0)
提交回复
热议问题