Cannot debug on Mac OS Lion with Rubymine 4

Hello,

Initialy I had some problems installing the debugger gems on the environment, but I have them installed now.
However, when I want to start up the debugger, it fails and the following message is given by Rubymine:

Users/arnedeherdt/.rvm/rubies/ruby-1.9.3-head/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:60:
    in `require': dlopen(/Users/arnedeherdt/.rvm/gems/ruby-1.9.3-head@s4clanapi/gems/ruby-debug-base19-0.11.25/lib/ruby_debug.bundle, 9):
       Symbol not found: _ruby_current_thread (LoadError)
  Referenced from: /Users/arnedeherdt/.rvm/gems/ruby-1.9.3-head@s4clanapi/gems/ruby-debug-base19-0.11.25/lib/ruby_debug.bundle
  Expected in: flat namespace
in /Users/arnedeherdt/.rvm/gems/ruby-1.9.3-head@s4clanapi/gems/ruby-debug-base19-0.11.25/lib/ruby_debug.bundle - /Users/arnedeherdt/.rvm/gems/ruby-1.9.3-head@s4clanapi/gems/ruby-debug-base19-0.11.25/lib/ruby_debug.bundle
 from /Users/arnedeherdt/.rvm/rubies/ruby-1.9.3-head/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:60:in `rescue in require'
 from /Users/arnedeherdt/.rvm/rubies/ruby-1.9.3-head/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:35:in `require'
 from /Users/arnedeherdt/.rvm/gems/ruby-1.9.3-head@s4clanapi/gems/ruby-debug-base19x-0.11.30.pre10/lib/ruby-debug-base.rb:1:in `'
 from /Users/arnedeherdt/.rvm/rubies/ruby-1.9.3-head/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
 from /Users/arnedeherdt/.rvm/rubies/ruby-1.9.3-head/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
 from /Applications/RubyMine.app/rb/gems/debug_preloader.rb:1:in `'
 from /Users/arnedeherdt/.rvm/rubies/ruby-1.9.3-head/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
 from /Users/arnedeherdt/.rvm/rubies/ruby-1.9.3-head/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'


what am I missing?
12 comments
Comment actions Permalink

Hello Arne,

you should uninstall ruby-debug-base19 because it conflicts with ruby-debug-base19x and debugging should work after that.

0
Comment actions Permalink

Removed the gem as you requested, but now I receive the error that the gem ruby-debug cannot be required when trying to debug with rubymine.
This is the list of gems currently installed:


*** LOCAL GEMS ***


activemodel (3.2.3)
activerecord (3.2.3)
activesupport (3.2.3)
archive-tar-minitar (0.5.2)
arel (3.0.2)
builder (3.0.0)
bundler (1.1.3)
capybara (1.1.2)
childprocess (0.3.1)
columnize (0.3.6)
cucumber (1.1.9)
daemons (1.1.8)
diff-lcs (1.1.3)
eventmachine (0.12.10)
ffi (1.0.11)
gherkin (2.9.3)
i18n (0.6.0)
json (1.6.6)
linecache19 (0.5.12)
mime-types (1.18)
multi_json (1.2.0)
mysql2 (0.3.11)
nokogiri (1.5.2)
rack (1.4.1)
rack-protection (1.2.0)
rack-test (0.6.1)
rake (0.9.2.2)
rbx-require-relative (0.0.9)
rspec (2.9.0)
rspec-core (2.9.0)
rspec-expectations (2.9.1, 2.9.0)
rspec-mocks (2.9.0)
ruby-debug-base19x (0.11.30.pre10)
ruby-debug-ide (0.4.17.beta8, 0.4.16)
ruby-debug19 (0.11.6)
ruby_core_source (0.1.5)
rubygems-bundler (0.3.0)
rubyzip (0.9.6.1)
selenium-webdriver (2.20.0)
sequel (3.34.1)
sinatra (1.3.2)
term-ansicolor (1.0.7)
thin (1.3.1)
tilt (1.3.3)
tzinfo (0.3.32)
xpath (0.1.4)


Should I also remove ruby-debug19?
0
Comment actions Permalink

You can try simply removing ruby-debug19 from your Gemfile,  sadly they don't work well together with ruby-debug-ide gem.

0
Comment actions Permalink

Thing is, I'm not using the Gemfile. Well I am using it, but it's not a Ruby on Rails application. My Gemfile only contains the required gems to run the project, not to help Rubymine in stuff.
Should I simply try uninstalling this gem?

0
Comment actions Permalink

I think that should do

0
Comment actions Permalink

Still getting the following error unfortunatly :

Cannot connect to the debugged process at port 50026 in 10s:

Error Output:
/Users/arnedeherdt/.rvm/rubies/ruby-1.9.3-head/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- ruby_debug (LoadError)
 from /Users/arnedeherdt/.rvm/rubies/ruby-1.9.3-head/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
 from /Users/arnedeherdt/.rvm/gems/ruby-1.9.3-head@s4clanapi/gems/ruby-debug-base19x-0.11.30.pre10/lib/ruby-debug-base.rb:1:in `'
 from /Users/arnedeherdt/.rvm/rubies/ruby-1.9.3-head/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
 from /Users/arnedeherdt/.rvm/rubies/ruby-1.9.3-head/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
 from /Applications/RubyMine.app/rb/gems/debug_preloader.rb:1:in `'
 from /Users/arnedeherdt/.rvm/rubies/ruby-1.9.3-head/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
 from /Users/arnedeherdt/.rvm/rubies/ruby-1.9.3-head/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'

0
Comment actions Permalink

Currently getting the follow issue with a different project:

12:17:18 PM Unable to attach test reporter to test framework or test framework quit unexpectedly
12:18:18 PM Error running OverallClanRanking.get_ranking: Failed to Install Gems. Following gems were not installed:
/Users/arnedeherdt/Library/Preferences/RubyMine40/rb/linecache19-0.5.13.gem:  
   Error installing linecache19-0.5.13.gem:
  ERROR: Failed to build gem native extension.
         /Users/arnedeherdt/.rvm/rubies/ruby-1.9.3-head/bin/ruby extconf.rb checking for vm_core.h... no /Users/arnedeherdt/.rvm/gems/ruby-1.9.3-head@s4clanapi/gems/ruby_core_source-0.1.5/lib/ruby_core_source.rb:39: Use RbConfig instead of obsolete and deprecated Config. checking for vm_core.h... no *** extconf.rb failed *** Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers.  Check the mkmf.log file for more details.  You may need configuration options.  Provided configuration options:  --with-opt-dir  --with-opt-include  --without-opt-include=${opt-dir}/include  --with-opt-lib  --without-opt-lib=${opt-dir}/lib  --with-make-prog  --without-make-prog  --srcdir=.  --curdir  --ruby=/Users/arnedeherdt/.rvm/rubies/ruby-1.9.3-head/bin/ruby  --with-ruby-dir  --without-ruby-dir  --with-ruby-include  --without-ruby-include=${ruby-dir}/include  --with-ruby-lib  --without-ruby-lib=${ruby-dir}/lib /Users/arnedeherdt/.rvm/gems/ruby-1.9.3-head@s4clanapi/gems/ruby_core_source-0.1.5/lib/contrib/uri_ext.rb:268:in `block (2 levels) in read': Looking for http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p173.tar.gz and all I got was a 404! (URI::NotFoundError)  from /Users/arnedeherdt/.rvm/rubies/ruby-1.9.3-head/lib/ruby/1.9.1/net/http.rb:1322:in `block (2 levels) in transport_request'  from /Users/arnedeherdt/.rvm/rubies/ruby-1.9.3-head/lib/ruby/1.9.1/net/http.rb:2671:in `reading_body'  from /Users/arnedeherdt/.rvm/rubies/ruby-1.9.3-head/lib/ruby/1.9.1/net/http.rb:1321:in `block in transport_request'  from /Users/arnedeherdt/.rvm/rubies/ruby-1.9.3-head/lib/ruby/1.9.1/net/http.rb:1316:in `catch'  from /Users/arnedeherdt/.rvm/rubies/ruby-1.9.3-head/lib/ruby/1.9.1/net/http.rb:1316:in `transport_request'  from /Users/arnedeherdt/.rvm/rubies/ruby-1.9.3-head/lib/ruby/1.9.1/net/http.rb:1293:in `request'  from /Users/arnedeherdt/.rvm/rubies/ruby-1.9.3-head/lib/ruby/1.9.1/net/http.rb:1286:in `block in request'  from /Users/arnedeherdt/.rvm/rubies/ruby-1.9.3-head/lib/ruby/1.9.1/net/http.rb:745:in `start'  from /Users/arnedeherdt/.rvm/rubies/ruby-1.9.3-head/lib/ruby/1.9.1/net/http.rb:1284:in `request'  from /Users/arnedeherdt/.rvm/gems/ruby-1.9.3-head@s4clanapi/gems/ruby_core_source-0.1.5/lib/contrib/uri_ext.rb:239:in `block in read'  from /Users/arnedeherdt/.rvm/gems/ruby-1.9.3-head@s4clanapi/gems/ruby_core_source-0.1.5/lib/contrib/uri_ext.rb:286:in `connect'  from /Users/arnedeherdt/.rvm/gems/ruby-1.9.3-head@s4clanapi/gems/ruby_core_source-0.1.5/lib/contrib/uri_ext.rb:234:in `read'  from /Users/arnedeherdt/.rvm/gems/ruby-1.9.3-head@s4clanapi/gems/ruby_core_source-0.1.5/lib/contrib/uri_ext.rb:128:in `download'  from /Users/arnedeherdt/.rvm/gems/ruby-1.9.3-head@s4clanapi/gems/ruby_core_source-0.1.5/lib/ruby_core_source.rb:55:in `block in create_makefile_with_core'  from /Users/arnedeherdt/.rvm/rubies/ruby-1.9.3-head/lib/ruby/1.9.1/tempfile.rb:320:in `open'  from /Users/arnedeherdt/.rvm/gems/ruby-1.9.3-head@s4clanapi/gems/ruby_core_source-0.1.5/lib/ruby_core_source.rb:51:in `create_makefile_with_core'  from extconf.rb:19:in `' Requesting http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p173.tar.gz   Gem files will remain installed in /Users/arnedeherdt/.rvm/gems/ruby-1.9.3-head@s4clanapi/gems/linecache19-0.5.13 for inspection. Results logged to /Users/arnedeherdt/.rvm/gems/ruby-1.9.3-head@s4clanapi/gems/linecache19-0.5.13/ext/trace_nums/gem_make.out
/Applications/RubyMine.app/rb/gems/ruby-debug-base19x-0.11.30.pre10.gem:  Error installing ruby-debug-base19x-0.11.30.pre10.gem:
 ERROR: Failed to build gem native extension.          
/Users/arnedeherdt/.rvm/rubies/ruby-1.9.3-head/bin/ruby extconf.rb checking for rb_method_entry_t.called_id in method.h... no checking for rb_control_frame_t.method_id in method.h... no checking for if rb_iseq_compile_with_option was added an argument filepath... no checking for rb_method_entry_t.called_id in method.h... no checking for rb_control_frame_t.method_id in method.h... no checking for if rb_iseq_compile_with_option was added an argument filepath... no /Users/arnedeherdt/.rvm/gems/ruby-1.9.3-head@s4clanapi/gems/ruby_core_source-0.1.5/lib/ruby_core_source.rb:39: Use RbConfig instead of obsolete and deprecated Config. checking for rb_method_entry_t.called_id in method.h... no checking for rb_control_frame_t.method_id in method.h... no checking for if rb_iseq_compile_with_option was added an argument filepath... no *** extconf.rb failed *** Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers.  Check the mkmf.log file for more details.  You may need configuration options.  Provided configuration options:  --with-opt-dir  --with-opt-include  --without-opt-include=${opt-dir}/include  --with-opt-lib  --without-opt-lib=${opt-dir}/lib  --with-make-prog  --without-make-prog  --srcdir=.  --curdir  --ruby=/Users/arnedeherdt/.rvm/rubies/ruby-1.9.3-head/bin/ruby  --with-ruby-dir  --without-ruby-dir  --with-ruby-include  --without-ruby-include=${ruby-dir}/include  --with-ruby-lib  --without-ruby-lib=${ruby-dir}/lib /Users/arnedeherdt/.rvm/gems/ruby-1.9.3-head@s4clanapi/gems/ruby_core_source-0.1.5/lib/contrib/uri_ext.rb:268:in `block (2 levels) in read': Looking for http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p173.tar.gz and all I got was a 404! (URI::NotFoundError)  from /Users/arnedeherdt/.rvm/rubies/ruby-1.9.3-head/lib/ruby/1.9.1/net/http.rb:1322:in `block (2 levels) in transport_request'  from /Users/arnedeherdt/.rvm/rubies/ruby-1.9.3-head/lib/ruby/1.9.1/net/http.rb:2671:in `reading_body'  from /Users/arnedeherdt/.rvm/rubies/ruby-1.9.3-head/lib/ruby/1.9.1/net/http.rb:1321:in `block in transport_request'  from /Users/arnedeherdt/.rvm/rubies/ruby-1.9.3-head/lib/ruby/1.9.1/net/http.rb:1316:in `catch'  from /Users/arnedeherdt/.rvm/rubies/ruby-1.9.3-head/lib/ruby/1.9.1/net/http.rb:1316:in `transport_request'  from /Users/arnedeherdt/.rvm/rubies/ruby-1.9.3-head/lib/ruby/1.9.1/net/http.rb:1293:in `request'  from /Users/arnedeherdt/.rvm/rubies/ruby-1.9.3-head/lib/ruby/1.9.1/net/http.rb:1286:in `block in request'  from /Users/arnedeherdt/.rvm/rubies/ruby-1.9.3-head/lib/ruby/1.9.1/net/http.rb:745:in `start'  from /Users/arnedeherdt/.rvm/rubies/ruby-1.9.3-head/lib/ruby/1.9.1/net/http.rb:1284:in `request'  from /Users/arnedeherdt/.rvm/gems/ruby-1.9.3-head@s4clanapi/gems/ruby_core_source-0.1.5/lib/contrib/uri_ext.rb:239:in `block in read'  from /Users/arnedeherdt/.rvm/gems/ruby-1.9.3-head@s4clanapi/gems/ruby_core_source-0.1.5/lib/contrib/uri_ext.rb:286:in `connect'  from /Users/arnedeherdt/.rvm/gems/ruby-1.9.3-head@s4clanapi/gems/ruby_core_source-0.1.5/lib/contrib/uri_ext.rb:234:in `read'  from /Users/arnedeherdt/.rvm/gems/ruby-1.9.3-head@s4clanapi/gems/ruby_core_source-0.1.5/lib/contrib/uri_ext.rb:128:in `download'  from /Users/arnedeherdt/.rvm/gems/ruby-1.9.3-head@s4clanapi/gems/ruby_core_source-0.1.5/lib/ruby_core_source.rb:55:in `block in create_makefile_with_core'  from /Users/arnedeherdt/.rvm/rubies/ruby-1.9.3-head/lib/ruby/1.9.1/tempfile.rb:320:in `open'  from /Users/arnedeherdt/.rvm/gems/ruby-1.9.3-head@s4clanapi/gems/ruby_core_source-0.1.5/lib/ruby_core_source.rb:51:in `create_makefile_with_core'  from extconf.rb:37:in `' Requesting http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p173.tar.gz   Gem files will remain installed in /Users/arnedeherdt/.rvm/gems/ruby-1.9.3-head@s4clanapi/gems/ruby-debug-base19x-0.11.30.pre10 for inspection. Results logged to /Users/arnedeherdt/.rvm/gems/ruby-1.9.3-head@s4clanapi/gems/ruby-debug-base19x-0.11.30.pre10/ext/ruby_debug/gem_make.out
(show balloon)



From what I understand it fails to build some native extension for a gem that's beeing downloaded by Rubymine on Mac OS Lion
0
Comment actions Permalink

Finally found the solution...

First you need to manually download the following gems:

http://rubyforge.org/frs/download.php/75414/linecache19-0.5.13.gem/noredirect
http://rubyforge.org/frs/download.php/75415/ruby-debug-base19-0.11.26.gem/noredirect
http://rubygems.org/gems/ruby-debug-base19x/versions/0.11.30.pre10

Then you need to install each gem file manually by adding the following at the end:

gem install <gemfile> -- --with-ruby-include=$rvm_path/src/ruby-1.9.3-head/

This assumes the usage of the latest ruby 1,9,3 like in my case.
This will install the gems in the correct order. Make sure you have no other versions installed or Rubymine will not pick them up.


This solved the problem in the end for me.

0
Comment actions Permalink

Right,

Even in some projects my fix does not work at all.
Currently working on a project in Rails 3.2, using Ruby 1.9.3 and I can install the required gems for debugging, but the debugger does not work at all. Break points are not hit, output does not work.

When can we see a working debugger for Mac OS Lion in IntelliJ or Rubymine ?

0
Comment actions Permalink

What debugger gems do you have installed? Please attach also your Gemfile

0
Comment actions Permalink

The list of gems is a few posts up.
And this only works if I install the gems manually. Rubymine (or IntelliJ) cannot install the gems itself, it spits out the errors I posted above as well.

The problem only occurs on Ruby 1.9.3 and not in the other versions. When I fire up the debugger in other ruby versions, the IDE prompts to install the gems and it works. Just not for 1.9.3

0
Comment actions Permalink

Please try removing ruby-debug-base gem, it may conflict with ruby-debug-base19x, causing breakpoints to be missed

0

Please sign in to leave a comment.