7

I am trying to install the ruby-debug-ide gem under ruby 2.1.2 . This to debug in Rubymine.

It worked for ruby1.9.3 but not for this version. here is the error:

1.3.5/lib/debugger/ruby_core_source/ruby-2.1.2-p95/***internal.h:209: error: expected ‘;’, ‘,’ or ‘)’ before ‘x’***

Here is the output.

I would love the ability to make sence or debug this in some way . A quick fix will also be great by the way :-)

Fetching: ruby-debug-ide-0.4.22.gem (100%)
    Building native extensions.  This could take a while...
    ERROR:  Error installing ruby-debug-ide:
        ERROR: Failed to build gem native extension.

        /Users/ohad/.rvm/rubies/ruby-2.1.2/bin/ruby mkrf_conf.rb
    Installing base gem
    Building native extensions.  This could take a while...
    Building native extensions.  This could take a while...
    ERROR: Failed to build gem native extension.

        /Users/ohad/.rvm/rubies/ruby-2.1.2/bin/ruby extconf.rb
    checking for vm_core.h... no
    checking for vm_core.h... no
    checking for vm_core.h... yes
    creating Makefile

    make "DESTDIR=" clean

    make "DESTDIR="
    compiling breakpoint.c
    compiling context.c
    compiling debase_internals.c
    In file included from /Users/ohad/.rvm/gems/ruby-2.1.2@v1_v2/gems/debugger-ruby_core_source-1.3.5/lib/debugger/ruby_core_source/ruby-2.1.2-p95/method.h:14,
                     from /Users/ohad/.rvm/gems/ruby-2.1.2@v1_v2/gems/debugger-ruby_core_source-1.3.5/lib/debugger/ruby_core_source/ruby-2.1.2-p95/vm_core.h:24,
                     from ./hacks.h:1,
                     from debase_internals.c:2:
    /Users/ohad/.rvm/gems/ruby-2.1.2@v1_v2/gems/debugger-ruby_core_source-1.3.5/lib/debugger/ruby_core_source/ruby-2.1.2-p95/***internal.h:209: error: expected ‘;’, ‘,’ or ‘)’ before ‘x’***
    make: *** [debase_internals.o] Error 1

    make failed, exit code 2

    Gem files will remain installed in /Users/ohad/.rvm/gems/ruby-2.1.2@v1_v2/gems/debase-0.0.9 for inspection.
    Results logged to /Users/ohad/.rvm/gems/ruby-2.1.2@v1_v2/extensions/x86_64-darwin-13/2.1.0-static/debase-0.0.9/gem_make.out
    /Users/ohad/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/ext/builder.rb:89:in `run'
      /Users/ohad/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/ext/builder.rb:51:in `block in make'
      /Users/ohad/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/ext/builder.rb:43:in `each'
      /Users/ohad/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/ext/builder.rb:43:in `make'
      /Users/ohad/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/ext/ext_conf_builder.rb:47:in `block in build'
      /Users/ohad/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/tempfile.rb:324:in `open'
      /Users/ohad/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/ext/ext_conf_builder.rb:17:in `build'
      /Users/ohad/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/ext/builder.rb:161:in `block (2 levels) in build_extension'
      /Users/ohad/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/ext/builder.rb:160:in `chdir'
      /Users/ohad/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/ext/builder.rb:160:in `block in build_extension'
      /Users/ohad/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/ext/builder.rb:159:in `synchronize'
      /Users/ohad/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/ext/builder.rb:159:in `build_extension'
      /Users/ohad/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/ext/builder.rb:198:in `block in build_extensions'
      /Users/ohad/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/ext/builder.rb:195:in `each'
      /Users/ohad/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/ext/builder.rb:195:in `build_extensions'
      /Users/ohad/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/installer.rb:677:in `build_extensions'
      /Users/ohad/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/installer.rb:232:in `install'
      /Users/ohad/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/request_set.rb:142:in `block in install'
      /Users/ohad/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/request_set.rb:126:in `each'
      /Users/ohad/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/request_set.rb:126:in `install'
      /Users/ohad/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/dependency_installer.rb:389:in `install'
      mkrf_conf.rb:34:in `rescue in <main>'
      mkrf_conf.rb:27:in `<main>'

    rake failed, exit code 1

    Gem files will remain installed in /Users/ohad/.rvm/gems/ruby-2.1.2@v1_v2/gems/ruby-debug-ide-0.4.22 for inspection.
    Results logged to /Users/ohad/.rvm/gems/ruby-2.1.2@v1_v2/extensions/x86_64-darwin-13/2.1.0-static/ruby-debug-ide-0.4.22/gem_make.out

Also, I failed to install with ruby rvm reinstall ruby-2.1.2 --disable-binary with this error

`dyld: Library not loaded: @@HOMEBREW_CELLAR@@/openssl/1.0.1i/lib/libssl.1.0.0.dylib
  Referenced from: /usr/local/opt/openssl/bin/openssl
  Reason: image not found
Failed reading certificates path for '/usr/local/opt/openssl/bin/openssl' with return code: ().
RVM autolibs is now configured with mode '2' => 'check and stop if missing',
please run `rvm autolibs enable` to let RVM do its job or run and read `rvm autolibs [help]`
or visit https://rvm,, for more information.
Requirements installation failed with status: 133.`
WebQube
  • 8,510
  • 12
  • 51
  • 93
  • I’ve had no problem installing it with Ruby 2.1.1 on Debian Jessie/Testing. From the captial “U” in Users I’m guessing you’re on OS X. Beware that some gems in OS X are tricky to install (e.g. Nokogiri). What OS X version are you running? If you’re using RVM, try Ruby 2.1.1 and start with a clean gemset wit `rvm gemset use --create debug_ide` and try again. I’ll have a look later in my Mac to see if it also fails. – Alf Aug 18 '14 at 07:55
  • I’ve successfully installed it on Ruby 2.1.2p95 (again in Debian). – Alf Aug 18 '14 at 08:37
  • Check this question, it might help: http://stackoverflow.com/questions/21055685/rubymine-6-0-2-unable-to-debug – Alf Aug 18 '14 at 08:40
  • It installs without a hitch in OS X Mavericks, Ruby 2.1.2p95 and a clean gemset. It’s definitely something in your environment. – Alf Aug 18 '14 at 18:41
  • hi @Alf, thanks for the replay. I am using OSx 10.9.4. tried the fresh gemset and t didn't work either. – WebQube Aug 19 '14 at 19:17
  • Are you using Homebrew, Macports...? – Alf Aug 19 '14 at 22:46
  • Homebrew. but not for install the gems. – WebQube Aug 21 '14 at 06:36
  • I think I realized what your problem is. I posted an answer below. – Alf Aug 22 '14 at 22:43
  • I updated my previous answer based on your output (missing OpenSSL libraries). Read the additional info to see if it works. – Alf Aug 25 '14 at 08:15

3 Answers3

3

The problem seems to be that the gem debugger-ruby_core_source can’t find the header file vm_core.h, which is part of Ruby’s source code. To install the source only (given that you have the binaries installed already) do:

$ rvm fetch ruby-2.1.2

You can also reinstall from source (a bit slower but it’s a good habit):

$ rvm reinstall ruby-2.1.2 --disable-binary

Update based on your additional error message

According to your message, you need to install OpenSSL:

$ brew install openssl

To sum up:

  1. You can’t install debugger-ruby_core_source because it needs the Ruby source for your Ruby version.
  2. You can’t install the Ruby source code with RVM because the Open SSL libraries are missing.

To remedy that type rvm autolibs homebrew so that RVM will install the missing packages if needed (you might need root permissions and enter your password when requested). This also lets RVM takes care of dependency problems from now on, you shouldn’t need to type the command again.

Alf
  • 1,414
  • 1
  • 15
  • 27
1

I had a similar issue, and installing the debugger-ruby_core_source gem manually before installing ruby-debug-ide worked.

Oscar Barrett
  • 3,135
  • 31
  • 36
0

I had this happen to me today, and solved it after running brew unlink openssl && brew link openssl --force

Hope it helps.

mauro_oto
  • 1,368
  • 17
  • 23