0

I've just installed neovim and I have problem with RubyGem.

Output of :CheckHealth indicates missing neovim RubyGem:

## Ruby provider
  - ERROR: Missing Neovim RubyGem
      - SUGGESTIONS:
        - Install or upgrade the neovim RubyGem using `gem install neovim`.
  - INFO: Ruby Version: ruby 2.2.6p396 (2016-11-15 revision 56800) [x86_64-linux]
  - INFO: Host Executable: not found
  - INFO: Host Version: not found

After installing sudo gem install neovim:

Successfully installed neovim-0.3.1
Parsing documentation for neovim-0.3.1
Done installing documentation for neovim after 0 seconds
1 gem installed

The output of :CheckHealth is the same as before:

## Ruby provider
  - ERROR: Missing Neovim RubyGem
      - SUGGESTIONS:
        - Install or upgrade the neovim RubyGem using `gem install neovim`.
  - INFO: Ruby Version: ruby 2.2.6p396 (2016-11-15 revision 56800) [x86_64-linux]
  - INFO: Host Executable: not found
  - INFO: Host Version: not found

Am I missing something? How can I fix this problem?

:echo has('ruby') returns 1

Thank you very much.

1

You may need to add the PATH of installed gems into your PATH.

You can do it like below in your .bashrc or .bash_profile or other shells' rc/profile files.

[ -d $HOME/.gem/ruby/2.4.0/bin ] && PATH=$HOME/.gem/ruby/2.4.0/bin:$PATH

export PATH together with all other PATH values.

  • Not sure if sudo gem install .. installs to ~/.gem, but the sudo probably isn't required in the first place. – Martin Tournoij Jul 3 '17 at 6:56
  • sudo is not required. – Aaron Shang Jul 7 '17 at 4:03
0

I discovered, on OpenSUSE that the binary file is renamed when installing the gem. So on my computer I need to set have this line in my init.vim

let g:ruby_host_prog="/usr/bin/neovim-ruby-host.ruby2.4"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.