neovim / neovim-ruby

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

undefined method `this`' for #<Gem::Specification> #30

Closed Quintasan closed 7 years ago

Quintasan commented 7 years ago

I got this after upgrading neovim today.

$ which neovim-ruby-host
/home/quintasan/.rvm/gems/ruby-2.3.1@harex/bin/neovim-ruby-host
$ neovim-ruby-host --version
/home/quintasan/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/rubygems/specification.rb:2158:in `method_missing': undefined method `this' for #<Gem::Specification:0xba705c neovim-0.3.1> (NoMethodError)
        from /home/quintasan/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/rubygems/specification.rb:1057:in `find_active_stub_by_path'
        from /home/quintasan/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:64:in `require'
        from /home/quintasan/.rvm/gems/ruby-2.3.1@harex/gems/neovim-0.3.1/bin/neovim-ruby-host:3:in `<top (required)>'
        from /home/quintasan/.rvm/gems/ruby-2.3.1@harex/bin/neovim-ruby-host:23:in `load'
        from /home/quintasan/.rvm/gems/ruby-2.3.1@harex/bin/neovim-ruby-host:23:in `<main>'
        from /home/quintasan/.rvm/gems/ruby-2.3.1@harex/bin/ruby_executable_hooks:15:in `eval'
        from /home/quintasan/.rvm/gems/ruby-2.3.1@harex/bin/ruby_executable_hooks:15:in `<main>'
alexgenco commented 7 years ago

That's strange... this doesn't appear anywhere in the 0.3.1 version. What's the output of

cat `which neovim-ruby-host`
Quintasan commented 7 years ago

cat 'which neovim-ruby-host'

#!/usr/bin/env ruby_executable_hooks
#
# This file was generated by RubyGems.
#
# The application 'neovim' is installed as part of a gem, and
# this file is here to facilitate running it.
#

require 'rubygems'

version = ">= 0.a"

if ARGV.first
  str = ARGV.first
  str = str.dup.force_encoding("BINARY") if str.respond_to? :force_encoding
  if str =~ /\A_(.*)_\z/ and Gem::Version.correct?($1) then
    version = $1
    ARGV.shift
  end
end

gem 'neovim', version
load Gem.bin_path('neovim', 'neovim-ruby-host', version)
Quintasan commented 7 years ago

The only thing that I recently did is upgrade neovim.

alexgenco commented 7 years ago

Upgrade the neovim editor or upgrade the neovim rubygem?

Quintasan commented 7 years ago

I'm afraid both are the latest versions.

alexgenco commented 7 years ago

But which did you upgrade before seeing the exception?

Quintasan commented 7 years ago

I mean the editor. I really should focus on what I'm reading today.

alexgenco commented 7 years ago

I've seen this issue pop up elsewhere, it seems like gem pristine neovim or gem pristine --all should fix it. Either that or it's a bad installation of RubyGems, in which case you should just use a more recent version of Ruby.

https://github.com/rubygems/rubygems/issues/1420 https://github.com/sj26/mailcatcher/issues/267 https://github.com/rubysec/bundler-audit/issues/157

Quintasan commented 7 years ago

So far so good. Looks like the problem is gone. Thanks.