Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby-on-rails-4/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用Rails 4应用程序运行Ruby调试IDE时出错_Ruby_Ruby On Rails 4_Ruby Debug Ide - Fatal编程技术网

使用Rails 4应用程序运行Ruby调试IDE时出错

使用Rails 4应用程序运行Ruby调试IDE时出错,ruby,ruby-on-rails-4,ruby-debug-ide,Ruby,Ruby On Rails 4,Ruby Debug Ide,我在使用Visual Studio代码运行带有Ruby调试IDE的Rails 4应用程序时遇到问题。这就是我得到的错误 /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> (NoMetho

我在使用Visual Studio代码运行带有Ruby调试IDE的Rails 4应用程序时遇到问题。这就是我得到的错误

/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>'
/home/ziyan/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/specification.rb:2158:in'method_missing'
:用于#的未定义方法“this”(NoMethodError)
from/home/ziyan/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/specification.rb:1057:“按路径查找活动的存根”
from/home/ziyan/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core\u ext/kernel\u 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`'
from/home/ziyan/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core\u ext/kernel\u require.rb:127:in'require'
from/home/ziyan/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core\u ext/kernel\u require.rb:127:“在require中救援”
from/home/ziyan/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core\u ext/kernel\u 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`'
from/home/ziyan/.rvm/gems/ruby-2.3。0@tbv_website/gems/ruby-debug-ide-0.6.0/bin/rdebug ide:8:in“require\u relative”
from/home/ziyan/.rvm/gems/ruby-2.3。0@tbv_website/gems/ruby-debug-ide-0.6.0/bin/rdebug-ide:8:in`'
from/home/ziyan/.rvm/gems/ruby-2.3。0@tbv_website/bin/rdebug ide:23:在“加载”中
from/home/ziyan/.rvm/gems/ruby-2.3。0@tbv_website/bin/rdebug ide:23:in`'
from/home/ziyan/.rvm/gems/ruby-2.3。0@tbv_website/bin/ruby可执行文件挂钩:15:in'eval'
from/home/ziyan/.rvm/gems/ruby-2.3。0@tbv_website/bin/ruby\u可执行文件\u挂钩:15:in`'
额外细节
  • Ruby 2.3.0
  • Ruby调试IDE 0.6
  • IDE:Visual Studio代码+
尝试了不同的变体
  • 尝试更新到Ruby 2.3.3
  • 已尝试将ruby调试ide降级为0.5
  • 已尝试将ruby调试ide升级到0.6.1.beta4
无功而返

额外的
我启动了一个新的Rails5+Ruby2.4.0项目,调试效果很好。它使用相同的ruby调试ide版本。所以ruby debug ide的版本应该可以正常工作。

我刚刚通过将rubygems更新到2.6.11版(我认为这是目前可用的最新版本)解决了这个问题

现在,VSCode中的调试再次起作用

我的当前配置

  • CentOS 7
  • RVM,最新稳定版本
  • VSCode,最新稳定版本,Ruby扩展名为0.10.4
  • Rails 4-Ruby 2.3.3(目前正在开发基于Solidus的电子商务)
  • Debase 0.2.1,Ruby调试IDE 0.6.1b4

我希望这会对您有所帮助。

我猜您的
Gemfile
中包含了一个
this
方法调用。也许它应该是一个注释,而单词前面的
#
丢失了?顺便说一句:错误还表明您使用的是Ruby
2.3
而不是
2.4
——您可能需要对此进行检查。我要补充的是,我使用了相同的扩展来调试Ruby 2.1.x和Ruby 2.2.x Rails应用程序,并且运行良好。它停止了对我来说传递到Ruby 2.3.x的工作(在.0、.1和.3中失败)。谢谢@MarcoSanfilippo,我无法更新到2.4,因为一些库坏了。我将试用2.2.x。太好了,让我试试吧!
$ gem update --system