RubyMine / IDEA ruby ​​debugger cannot load linecache gem in layered mode

Run the debugger in the batch (check the box "Run the script context in the package context" on the target launch link tab) in IDEA 13 (and earlier version, for example, 11) Ruby, I always get

/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

The linecache gem is installed correctly

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

Putting linecache in the gemfile doesn't help at all.

But launching a debugger for the same target task without a bunch (unchecking the "Run script in package context" box). Of course, it would be easy to create a conflict between the pearl and the context of the bundle.

How can this be fixed?

+4
2

/:

require 'rubygems'

ruby-debug-base.rb(, , RM/Idea, .)

, bundler. , .

+6

, , Hacking Bear, :

: Run > Edit Configurations

Ruby arguments: -r rubygems

man- Ruby:

   -r library
          Causes Ruby to load the library using require.  It is useful when using -n or -p.
0

Source: https://habr.com/ru/post/1525985/


All Articles