16 Replies Last post: Mar 14, 2012 5:03 PM by Gary Schwartzbard  
Shigeya Suzuki Newbie 12 posts since
Sep 2, 2011
Currently Being Moderated

Mar 2, 2012 10:48 AM

How to configure debugger with Ruby 1.9.3-p125

Hi,

 

I'm trying to use debugger with rspec with following version of software:

  rails 3.2.1

  rvm (stable 1.10.2)

  ruby 1.9.3-p125

  MacOS X 10.7.3, Xcode 4.3

 

Now, I figured out a configuration to run "rails console --debugger" with information I've gotten from:

  http://stackoverflow.com/questions/6438116/rails-with-ruby-debugger-throw-symbol-not-found-ruby-current-thread-loaderro

  (I used answer refer to this gist: https://gist.github.com/1331533 )

 

I set a break point, and run rspec.

Unfortunately, with this configuration, rspec stop with error.

 

/Users/shigeya/.rvm/rubies/ruby-1.9.3-p125/bin/ruby -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) "/Applications/RubyMine 4.0.1.app/rb/testing/runner/specs_in_folder_runner.rb"
Testing started at 15:06 ...
/Users/shigeya/.rvm/rubies/ruby-1.9.3-p125/bin/ruby -e at_exit{sleep(1)};$stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) /Users/shigeya/.rvm/gems/ruby-1.9.3-p125@aimm3/gems/ruby-debug-ide-0.4.17.beta8/bin/rdebug-ide --port 61575 -- /Users/shigeya/.rvm/gems/ruby-1.9.3-p125@aimm3/bin/rspec --require teamcity/spec/runner/formatter/teamcity/formatter --format Spec::Runner::Formatter::TeamcityFormatter
<< source paths here >>
Fast Debugger (ruby-debug-ide 0.4.17.beta8, ruby-debug-base 0.11.30.pre10) listens on 127.0.0.1:61575
Work directory: /Users/shigeya/work/aimm3/}
Searching files.... 
=========================================
<< rspec sources here..>>
 
 
47 files were found.
=========================================
RSpec script : /Users/shigeya/.rvm/gems/ruby-1.9.3-p125@aimm3/bin/rspec
 
Spec Options:
[]
=========================================
Running specs...
Command line: 
["/Users/shigeya/.rvm/rubies/ruby-1.9.3-p125/bin/ruby", "-e", "at_exit{sleep(1)};$stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift)", "/Users/shigeya/.rvm/gems/ruby-1.9.3-p125@aimm3/gems/ruby-debug-ide-0.4.17.beta8/bin/rdebug-ide", "--port", "61575", "--", "/Users/shigeya/.rvm/gems/ruby-1.9.3-p125@aimm3/bin/rspec", "--require", "teamcity/spec/runner/formatter/teamcity/formatter", "--format", "Spec::Runner::Formatter::TeamcityFormatter",
 << SPEC PATHS >> ]
dyld: lazy symbol binding failed: Symbol not found: _rb_vm_get_sourceline
  Referenced from: /Users/shigeya/.rvm/gems/ruby-1.9.3-p125@aimm3/gems/ruby-debug-base19x-0.11.30.pre10/lib/ruby_debug.bundle
  Expected in: flat namespace
 
dyld: Symbol not found: _rb_vm_get_sourceline
  Referenced from: /Users/shigeya/.rvm/gems/ruby-1.9.3-p125@aimm3/gems/ruby-debug-base19x-0.11.30.pre10/lib/ruby_debug.bundle
  Expected in: flat namespace
 
/Users/shigeya/.rvm/gems/ruby-1.9.3-p125@global/gems/rake-0.9.2.2/lib/rake/file_utils.rb:53:in `block in create_shell_runner': Command failed with status (): [/Users/shigeya/.rvm/rubies/ruby-1.9.3-p125...] (RuntimeError)
     from /Users/shigeya/.rvm/gems/ruby-1.9.3-p125@global/gems/rake-0.9.2.2/lib/rake/file_utils.rb:45:in `call'
     from /Users/shigeya/.rvm/gems/ruby-1.9.3-p125@global/gems/rake-0.9.2.2/lib/rake/file_utils.rb:45:in `sh'
     from /Users/shigeya/.rvm/gems/ruby-1.9.3-p125@global/gems/rake-0.9.2.2/lib/rake/file_utils_ext.rb:39:in `sh'
     from /Applications/RubyMine 4.0.1.app/rb/testing/runner/specs_in_folder_runner.rb:139:in `<top (required)>'
     from -e:1:in `load'
     from -e:1:in `<main>'
 
Process finished with exit code 1




 

How I can make Rubymine happy?

 

Current Gemfile is here: https://gist.github.com/1955987

Dennis Ushakov JetBrains 410 posts since
Sep 10, 2008
Currently Being Moderated
Mar 2, 2012 2:31 PM in response to: Shigeya Suzuki
Re: How to configure debugger with Ruby 1.9.3-p125

It looks like your problem is caused by XCode 4.3. Please see rvm requirements output:

Xcode 4.2:

* is only supported by ruby 1.9.3+ using command line flag: --with-gcc=clang

* it breaks gems with native extensions, especially DB drivers.

Dennis Ushakov JetBrains 410 posts since
Sep 10, 2008
Currently Being Moderated
Mar 2, 2012 3:28 PM in response to: Shigeya Suzuki
Re: How to configure debugger with Ruby 1.9.3-p125

For me even XCode 4.2 worked ok, but 4.3 doesn't

Dennis Ushakov JetBrains 410 posts since
Sep 10, 2008
Currently Being Moderated
Mar 4, 2012 11:42 PM in response to: Shigeya Suzuki
Re: How to configure debugger with Ruby 1.9.3-p125

Yes, it is possible to debug rspec, but you should remove any references to CLI debug gem from your gemfile, because IDE debugger won't stop on breakpoints otherwise

Dennis Ushakov JetBrains 410 posts since
Sep 10, 2008
Currently Being Moderated
Mar 4, 2012 11:41 PM in response to: Shigeya Suzuki
Re: How to configure debugger with Ruby 1.9.3-p125

Here's the corresponding issue is Ruby bugtracker. You may also want to check this guide on setting up XCode 4.3 to work with 1.9.3. I won't be able to check it until tomorrow, but it looks ok.

Gary Schwartzbard Newbie 2 posts since
Mar 14, 2012
Currently Being Moderated
Mar 14, 2012 4:09 PM in response to: Shigeya Suzuki
Re: How to configure debugger with Ruby 1.9.3-p125

Would you be able to provide a little more detail on how you fixed the problem? I tried the Homebrew guide above with no luck. I have rvm 1.9.3-head selected and I tried installing ruby-debug-base19x by executing:

 

sudo gem install ruby-debug-base19x -- --with-ruby-include=/Users/USERNAME/.rvm/src/ruby-1.9.3-head/

 

but I still get:

 

make

compiling breakpoint.c

compiling ruby_debug.c

ruby_debug.c:24: error: conflicting types for ‘rb_iseq_compile_with_option’

/Users/USERNAME/.rvm/src/ruby-1.9.3-head/vm_core.h:505: error: previous declaration of ‘rb_iseq_compile_with_option’ was here

ruby_debug.c: In function ‘call_at_line_unprotected’:

 

Any ideas?

Gary Schwartzbard Newbie 2 posts since
Mar 14, 2012
Currently Being Moderated
Mar 14, 2012 5:03 PM in response to: Shigeya Suzuki
Re: How to configure debugger with Ruby 1.9.3-p125

Looks to be working. Thank you!

More Like This

  • Retrieving data ...