0

So I'm trying to install debase in my gemfile and explosions are happening. Here's what the output looks like...

(Ok so there was a bunch of stuff here that I removed cause it got fixed. Now I have only this remaining error)

UPDATE 2:

...installing ruby-debug19 helped to install vm_core.h (thank you to Alter Lagos for recommending that). Now I have a new error message...

Fetching debase 0.2.1
Installing debase 0.2.1 with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

        /home/fonso/.rbenv/versions/1.9.3-p551/bin/ruby extconf.rb
checking for vm_core.h... yes
creating Makefile

make
compiling breakpoint.c
In file included from breakpoint.c:1:0:
./debase_internals.h:5:24: fatal error: ruby/debug.h: No such file or directory
compilation terminated.
make: *** [breakpoint.o] Error 1


Gem files will remain installed in /home/fonso/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/gems/debase-0.2.1 for inspection.
Results logged to /home/fonso/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/gems/debase-0.2.1/ext/gem_make.out

An error occurred while installing debase (0.2.1), and Bundler cannot continue.
Make sure that `gem install debase -v '0.2.1' --source 'http://rubygems.org/'` succeeds before bundling.

In Gemfile:
  debase

Anyone know how to solve this mystery?

thefonso
  • 3,220
  • 6
  • 37
  • 54
  • 2
    Usually the answer is found in `mkmf.log` and `gem_make.out`, per the instructions. Typically, a required library cannot be found. Look for errors like "library not found". – Jared Beck Jun 01 '21 at 22:05
  • Maybe [installing these packages](https://stackoverflow.com/a/14217431/895789) will solve your issue? – Alter Lagos Jun 01 '21 at 23:11
  • @spickermann using deduction, and assuming competence on the part of this developer (me), what are some possibilities for the nature of this app? – thefonso Jun 02 '21 at 08:36
  • @AlterLagos that helped a bit. That installed the vm_core.h thing, so that error is gone. But replaced with a new one..."In file included from breakpoint.c:1:0: ./debase_internals.h:5:24: fatal error: ruby/debug.h: No such file or directory" – thefonso Jun 02 '21 at 10:03

2 Answers2

0

"Failed to build gem native extension" means your computer had to compile a C extension to install the gem. This is actually common. Many gems like pg include C extensions. It's also common for people to encounter this error message. It just means your operating system lacks a certain package that would provide the C files needed to compile the extension.

The errors can be tricky to solve though because it's not a matter of changing what you're doing. You're installing the gem just fine. It's your environment that needs to be changed. You need to know which packages to install for your operating system for that version of the Gem.

Many tutorials include lists of packages you should install. For example, https://gorails.com/setup/ubuntu/18.04 tells you that, if you're installing the latest version of Ruby right now (3.0.1), you install: git-core zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev software-properties-common libffi-dev nodejs yarn

These instructions are meant for Ubuntu 18.04. It would be different if you were using a different version of Ubuntu or a different operating system like MacOS. Also, your question shows you using a very old version of Ruby, 1.9.3. If you must use this old version, this could make this even harder for you, because there's no guarantee you'll find system packages that would work with the C extension that version of that gem wants to compile. I'd suggest using a recent version of Ruby if you can.

Matt Welke
  • 1,441
  • 1
  • 15
  • 40
  • See UPDATE 2 in the question above. It looks like installing ruby-debug19 helped with the c extension but now yields a new error. – thefonso Jun 02 '21 at 11:13
  • Exactly. That's what makes this tricky. You play whack a mole solving the missing dependencies one at a time. Sounds like your next step is to learn which operating system package you need to install to enable that new C extension to compile successfully. – Matt Welke Jun 02 '21 at 14:03
0

Annnnnd the answer is...For old apps using ruby 1.9.x use

gem 'ruby-debug-base19x', '~> 0.11.32'

instead of

gem debase

in your Gemfile per the readme for ruby-debug-ide https://github.com/ruby-debug/ruby-debug-ide

Now the gems install fine.

rdebug-ide command is not working tho', I've posted that question here... ruby-debu-ide command exploading in my face

thefonso
  • 3,220
  • 6
  • 37
  • 54