neovim / neovim-ruby

Ruby support for Neovim
MIT License
340 stars 17 forks source link

Ruby support does not keep up with directory changes #21

Closed yourealwaysbe closed 7 years ago

yourealwaysbe commented 8 years ago

If the directory is changed (e.g. via a :cd command), calls to ruby are still evaluated in the directory nvim was originally opened in. Vim will evaluate ruby in the current directory.

To reproduce:

alexgenco commented 8 years ago

Thanks, I'll look into this soon

alexgenco commented 8 years ago

@yourealwaysbe can you try building from https://github.com/alexgenco/neovim-ruby/pull/22 and see if it resolves your issues?

yourealwaysbe commented 8 years ago

Sorry, i do not know how to do this. If i clone the branch and run

gem build neovim.gemspec
gem install neovim-0.3.1.gem

and start nvim, i just get

Cannot find the neovim RubyGem. Try :CheckHealth
yourealwaysbe commented 8 years ago

That said, if i install version 0.3.1 through the Arch Linux AUR, the problem appears to be fixed. Thanks.

alexgenco commented 8 years ago

So 0.3.1 doesn't include this change, so I think you must be running the locally installed version. What's the output of neovim-ruby-host -V, and also the :CheckHealth command?

In the future, the best way to install it from source is to clone it, check out the branch, then run rake install. Although I think your way should have worked too, so that's a little puzzling.

yourealwaysbe commented 8 years ago

neovim-ruby-host -V

0.3.1

:CheckHealth

## Ruby provider
  - SUCCESS: Found Neovim RubyGem
  - INFO: Ruby Version: ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-linux]
  - INFO: Host Executable: /usr/bin/neovim-ruby-host
  - INFO: Host Version: 0.3.1

Though i also still have neovim installed in my local ~/.gem. After deleting it, the problem returns. So i guess something was missing from the gem install that my package manager install provided, but then the local ~/.gem version was used when actually running it... The output of the two commands remains the same after deleting the local ~/.gem version.

edit: uninstalling ruby-neovim via my package manager and running rake install still results in "Cannot find the neovim RubyGem. Try :CheckHealth". CheckHealth reports it cannot find the neovim rubygem. Though maybe that's something screwy with my machine.

alexgenco commented 8 years ago

Are you using a ruby version manager? I'm wondering if nvim's ruby doesn't have access to wherever rake install is installing it. What's the output of :ruby puts RUBY_VERSION, RUBY_PATCHLEVEL in nvim?

ashang commented 7 years ago

I run into the same issue, and solved by adding the gem path. https://stackoverflow.com/questions/42164311/missing-neovim-rubygem/44339982#44339982