1

I am having a problem running a Rails 4 app with Ruby Debug IDE using Visual Studio Code. This is the error I get.

/home/ziyan/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/specification.rb:2158:in `method_missing'
: undefined method `this' for #<Gem::Specification:0x1271b08 debase-0.2.1> (NoMethodError)
    from /home/ziyan/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/specification.rb:1057:in `find_active_stub_by_path'
    from /home/ziyan/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:64:in `require'
    from /home/ziyan/.rvm/gems/ruby-2.3.0@tbv_website/gems/debase-0.2.1/lib/debase.rb:4:in `<top (required)>'
    from /home/ziyan/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:127:in `require'
    from /home/ziyan/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:127:in `rescue in require'
    from /home/ziyan/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:40:in `require'
    from /home/ziyan/.rvm/gems/ruby-2.3.0@tbv_website/gems/ruby-debug-ide-0.6.0/lib/ruby-debug-ide.rb:8:in `<top (required)>'
    from /home/ziyan/.rvm/gems/ruby-2.3.0@tbv_website/gems/ruby-debug-ide-0.6.0/bin/rdebug-ide:8:in `require_relative'
    from /home/ziyan/.rvm/gems/ruby-2.3.0@tbv_website/gems/ruby-debug-ide-0.6.0/bin/rdebug-ide:8:in `<top (required)>'
    from /home/ziyan/.rvm/gems/ruby-2.3.0@tbv_website/bin/rdebug-ide:23:in `load'
    from /home/ziyan/.rvm/gems/ruby-2.3.0@tbv_website/bin/rdebug-ide:23:in `<main>'
    from /home/ziyan/.rvm/gems/ruby-2.3.0@tbv_website/bin/ruby_executable_hooks:15:in `eval'
    from /home/ziyan/.rvm/gems/ruby-2.3.0@tbv_website/bin/ruby_executable_hooks:15:in `<main>'

Extra details

  • Ruby 2.3.0
  • Ruby Debug IDE 0.6
  • IDE: Visual Studio Code + vscode-ruby

Different variations tried

  • Tried updating to Ruby 2.3.3
  • Tried downgrading ruby-debug-ide to 0.5
  • Tried upgrading ruby-debug-ide to 0.6.1.beta4

With no success

Extra

I started a new Rails 5 + Ruby 2.4.0 project and debugging works fine with it. It uses the same ruby-debug-ide version. So the version of ruby-debug-ide should be working.

Ziyan Junaideen
  • 3,270
  • 7
  • 46
  • 71
  • I would guess that your `Gemfile` includes a `this` method call.perhaps it should be a comment and the `#` in front of the word is missing? Btw: The error also tells that you use Ruby `2.3` not `2.4` - you might want to check that. – spickermann Mar 25 '17 at 05:51
  • 1
    I would add that I used the same extension to debug Ruby 2.1.x and Ruby 2.2.x Rails applications and it worked fine. It stopped working for me passing to Ruby 2.3.x (failed with .0, .1 and .3). – Marco Sanfilippo Apr 07 '17 at 13:17
  • Thanks @MarcoSanfilippo, I couldn't update to 2.4 because some lib broke. I will try with 2.2.x – Ziyan Junaideen Apr 08 '17 at 03:25

1 Answers1

3

I just solved the issue by updating rubygems to version 2.6.11 (I think it's the latest version available as of today).

$ gem update --system

Now debugging in VSCode works again.

My current config.

  • CentOS 7
  • RVM, latest stable
  • VSCode, latest stable with Ruby extension 0.10.4
  • Rails 4 - Ruby 2.3.3 (currently working on a Solidus-based e-commerce)
  • Debase 0.2.1, Ruby-Debug-IDE 0.6.1b4

I hope this will help you.

Marco Sanfilippo
  • 293
  • 3
  • 11