ruby-on-rails – RubyMine / IDEA ruby​​调试器无法在bundler模​​式下加载linecache gem

前端之家收集整理的这篇文章主要介绍了ruby-on-rails – RubyMine / IDEA ruby​​调试器无法在bundler模​​式下加载linecache gem前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
在捆绑器中启动调试器(在运行目标的捆绑器选项卡中选中“在捆绑包上下文中运行脚本”选项)在IDEA 13(以及早期版本,例如11) Ruby中,我总是得到

/Users/me/.rvm/rubies/ree-1.8.7-2012.02/bin/ruby -e at_exit{sleep(1)};$stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) /Users/me/.rvm/gems/ree-1.8.7-2012.02/gems/ruby-debug-ide-0.4.22/bin/rdebug-ide --disable-int-handler --port 58100 --dispatcher-port 58101 -- /Users/me/railproj/script/spec --format specdoc spec/**/any_ruby_spec.rb
/Users/me/.rvm/gems/ree-1.8.7-2012.02/gems/ruby-debug-base-0.10.5.rc9/lib/ruby-debug-base.rb:3:in `require': no such file to load -- linecache (LoadError)
    from /Users/me/.rvm/gems/ree-1.8.7-2012.02/gems/ruby-debug-base-0.10.5.rc9/lib/ruby-debug-base.rb:3
    from /Users/me/Library/Application Support/IntelliJIdea13/ruby/rb/gems/debug_preloader.rb:2:in `require'
    from /Users/me/Library/Application Support/IntelliJIdea13/ruby/rb/gems/debug_preloader.rb:2

linecache gem正确安装

$gem which linecache
/Users/me/.rvm/gems/ree-1.8.7-2012.02/gems/linecache-0.46/lib/linecache.rb

将行缓存放在Gemfile中根本没有用.

但是为没有bundler的同一个运行目标启动调试器(取消选中“在bundle上下文中运行脚本”)可以工作.当然,人们可以通过捆绑上下文轻松地获得宝石冲突.

怎么解决这个问题?

解决方法

我找到了解决方案/解决方法:只需添加

require 'rubygems'

到ruby-debug-base.rb的第一行(确保添加到RM / Idea使用的右边,因为可以有多个版本.)

但我仍然不知道为什么没有捆绑选项它会工作.我觉得情况恰恰相反.

猜你在找的IDEA相关文章