Unable to install debase gem
Asked Answered
I

2

8

I am trying to debug code in Rubymine. It looks like we need to install debase first. I tried to search in google but could not find any solution.

$ ruby -v
ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-darwin20]


$ sudo gem install debase
  Building native extensions. This could take a while...
  ERROR:  Error installing debase:
  ERROR: Failed to build gem native extension.

current directory: /usr/local/lib/ruby/gems/3.0.0/gems/debase-0.2.4.1/ext
/usr/local/opt/ruby/bin/ruby -I /usr/local/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0 -r 
./siteconf20210301-33052-suq8dd.rb extconf.rb
checking for vm_core.h... no
checking for vm_core.h... no
checking for vm_core.h... yes
checking for iseq.h... yes
checking for version.h... yes
checking for vm_core.h... yes
checking for vm_insnhelper.h... yes
checking for vm_core.h... yes
checking for method.h... yes
creating Makefile

current directory: /usr/local/lib/ruby/gems/3.0.0/gems/debase-0.2.4.1/ext
make "DESTDIR=" clean

current directory: /usr/local/lib/ruby/gems/3.0.0/gems/debase-0.2.4.1/ext
make "DESTDIR="
compiling breakpoint.c
compiling context.c
compiling debase_internals.c
debase_internals.c:111:8: error: implicit declaration of function 'RHASH_EMPTY_P' is invalid 
in C99 [-Werror,-Wimplicit-function-declaration]
if (!RHASH_EMPTY_P(catchpoints)) return;
   ^
debase_internals.c:319:25: warning: initializing 'rb_control_frame_t *' (aka 'struct 
rb_control_frame_struct *') with an expression of type 'const rb_control_frame_t *' (aka 
'const struct rb_control_frame_struct *') discards qualifiers [-Wincompatible-pointer-types- 
discards-qualifiers]
rb_control_frame_t *start_cfp = RUBY_VM_END_CONTROL_FRAME(TH_INFO(thread));
                    ^           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
debase_internals.c:768:3: warning: incompatible pointer types passing 'void (VALUE, VALUE)' 
(aka 'void (unsigned long, unsigned long)') to parameter of type 'VALUE (*)(VALUE, VALUE)' 
(aka 'unsigned long (*)(unsigned long, unsigned long)') [-Wincompatible-pointer-types]
rb_define_module_function(mDebase, "set_trace_flag_to_iseq", Debase_set_trace_flag_to_iseq, 1);

^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 /usr/local/Cellar/ruby/3.0.0_1/include/ruby-3.0.0/ruby/internal/anyargs.h:337:142: note: 
expanded from macro 'rb_define_module_function'
#define rb_define_module_function(mod, mid, func, arity)    
RBIMPL_ANYARGS_DISPATCH_rb_define_module_function((arity), (func))((mod), (mid), (func), 
(arity))
                                                                                                                                         
^~~~~~
/usr/local/Cellar/ruby/3.0.0_1/include/ruby-3.0.0/ruby/internal/anyargs.h:273:1: note: 
passing argument to parameter here
RBIMPL_ANYARGS_DECL(rb_define_module_function, VALUE, const char *)
^
/usr/local/Cellar/ruby/3.0.0_1/include/ruby-3.0.0/ruby/internal/anyargs.h:255:72: note: 
expanded from macro 'RBIMPL_ANYARGS_DECL'
RBIMPL_ANYARGS_ATTRSET(sym) static void sym ## _01(__VA_ARGS__, VALUE(*)(VALUE, VALUE), int); 
\
                                                                   ^
debase_internals.c:771:3: warning: incompatible pointer types passing 'void (VALUE, VALUE)' 
(aka 'void (unsigned long, unsigned long)') to parameter of type 'VALUE (*)(VALUE, VALUE)' 
(aka 'unsigned long (*)(unsigned long, unsigned long)') [-Wincompatible-pointer-types]
rb_define_module_function(mDebase, "unset_iseq_flags", Debase_unset_trace_flags, 1);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/Cellar/ruby/3.0.0_1/include/ruby-3.0.0/ruby/internal/anyargs.h:337:142: note: 
expanded from macro 'rb_define_module_function'
#define rb_define_module_function(mod, mid, func, arity)    
RBIMPL_ANYARGS_DISPATCH_rb_define_module_function((arity), (func))((mod), (mid), (func), 
(arity))
                                                                                                                                         
^~~~~~
/usr/local/Cellar/ruby/3.0.0_1/include/ruby-3.0.0/ruby/internal/anyargs.h:273:1: note: 
passing argument to parameter here
RBIMPL_ANYARGS_DECL(rb_define_module_function, VALUE, const char *)
^
/usr/local/Cellar/ruby/3.0.0_1/include/ruby-3.0.0/ruby/internal/anyargs.h:255:72: note: 
expanded from macro 'RBIMPL_ANYARGS_DECL'
RBIMPL_ANYARGS_ATTRSET(sym) static void sym ## _01(__VA_ARGS__, VALUE(*)(VALUE, VALUE), int); \
                                                                   ^
3 warnings and 1 error generated.
make: *** [debase_internals.o] Error 1

make failed, exit code 2

Gem files will remain installed in /usr/local/lib/ruby/gems/3.0.0/gems/debase-0.2.4.1 for 
inspection.
Results logged to /usr/local/lib/ruby/gems/3.0.0/extensions/x86_64-darwin-20/3.0.0/debase- 
0.2.4.1/gem_make.out
Infantine answered 1/3, 2021 at 19:5 Comment(7)
You are likely using an ancient library or an ancient Ruby version. Add both versions to the question and link to the library's home page.Lauritz
@D.SM This looks like it's being built on Ruby 3.0.0, so unless you're from the future...Elysia
Have you tried with Ruby 2.7.2 to see if this a Ruby 3.0 specific quirk? If so, you may want to open an issue for that project.Elysia
That is probably the reason then.Lauritz
@Elysia I have tried with ruby 2.6.0 first which did not work. So I upgraded to 3.0.0. But same issue.Infantine
I used the pre-release gem, and it worked with Ruby 3 gem install debase --pre. Ticket here github.com/ruby-debug/debase/issues/92Bandy
Same error as @TechnicalShil mentioned: macOS 11.6, ruby-3.0.0 [ x86_64 ], with RVM use. When installing the pre version, it worked.Caseose
P
0

Debase isn't updated regularly anymore, and RubyMine seems to depend on a fork.

The solution for me was to upgrade RubyMine to the latest version and try debugging again so it can use the latest Debase fork which fixes the error.

Presumptive answered 18/7 at 20:21 Comment(0)
U
0

Using some extra flags helped in my case gem install debase -v 0.2.4.1 -- --with-cflags=-Wno-error=incompatible-function-pointer-types.

Ultimately answered 2/8 at 11:51 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.