加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

ruby-on-rails – RubyMine / IDEA ruby??调试器无法在bundler模

发布时间:2020-12-17 03:06:33 所属栏目:百科 来源:网络整理
导读:在捆绑器中启动调试器(在运行目标的捆绑器选项卡中选中“在捆绑包上下文中运行脚本”选项)在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;
在捆绑器中启动调试器(在运行目标的捆绑器选项卡中选中“在捆绑包上下文中运行脚本”选项)在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使用的右边,因为可以有多个版本.)

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

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读