Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BuildError: ERROR: Failed to build gem native extension byebug 8.2.1 #835

Open
Cristopheer96 opened this issue Aug 29, 2022 · 5 comments
Open

Comments

@Cristopheer96
Copy link

Cristopheer96 commented Aug 29, 2022

Hello everyone, a few months ago I had the exact same problem with a 2015 Mac and I solved it by following the steps suggested at: #280. However now that I want to run the same project on my Macbook Air with M1 chip I get the error and the above solution doesn't work.
I share the record.
Enviroment: Macbook Air M1, ruby 2.3.1, rails 4.2.2

When i run : /usr/bin/clang -v
Apple clang version 13.1.6 (clang-1316.0.21.2.5)
Target: arm64-apple-darwin21.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

--- run : /usr/local/opt/llvm/bin/clang -v
zsh: no such file or directory: /usr/local/opt/llvm/bin/clang

Thanks in advance


 sudo gem install byebug -v '8.2.1' --source 'https://rubygems.org/'
Building native extensions.  This could take a while...
ERROR:  Error installing byebug:
	ERROR: Failed to build gem native extension.

    current directory: /Users/cristopherhuarocolivera/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/byebug-8.2.1/ext/byebug
/Users/cristopherhuarocolivera/.rbenv/versions/2.3.1/bin/ruby -r ./siteconf20220828-3820-urksmm.rb extconf.rb
creating Makefile

current directory: /Users/cristopherhuarocolivera/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/byebug-8.2.1/ext/byebug
make "DESTDIR=" clean

current directory: /Users/cristopherhuarocolivera/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/byebug-8.2.1/ext/byebug
make "DESTDIR="
compiling locker.c
compiling byebug.c
byebug.c:198:27: error: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts [-Werror,-Wcompound-token-split-by-macro]
  return call_at(ctx, dc, rb_intern("at_line"), 0, Qnil);
                          ^~~~~~~~~~~~~~~~~~~~
/Users/cristopherhuarocolivera/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/ruby.h:1737:23: note: expanded from macro 'rb_intern'
        __extension__ (CONST_ID_CACHE((ID), (str))) : \
                      ^
byebug.c:198:27: note: '{' token is here
  return call_at(ctx, dc, rb_intern("at_line"), 0, Qnil);
                          ^~~~~~~~~~~~~~~~~~~~
/Users/cristopherhuarocolivera/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/ruby.h:1737:24: note: expanded from macro 'rb_intern'
        __extension__ (CONST_ID_CACHE((ID), (str))) : \
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/cristopherhuarocolivera/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/ruby.h:1730:37: note: expanded from macro 'CONST_ID_CACHE'
#define CONST_ID_CACHE(result, str) RUBY_CONST_ID_CACHE(result, str)
                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/cristopherhuarocolivera/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/ruby.h:1722:5: note: expanded from macro 'RUBY_CONST_ID_CACHE'
    {                                                   \
    ^
byebug.c:198:27: error: '}' and ')' tokens terminating statement expression appear in different macro expansion contexts [-Werror,-Wcompound-token-split-by-macro]
  return call_at(ctx, dc, rb_intern("at_line"), 0, Qnil);
                          ^~~~~~~~~~~~~~~~~~~~
/Users/cristopherhuarocolivera/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/ruby.h:1737:24: note: expanded from macro 'rb_intern'
        __extension__ (CONST_ID_CACHE((ID), (str))) : \
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/cristopherhuarocolivera/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/ruby.h:1730:37: note: expanded from macro 'CONST_ID_CACHE'
#define CONST_ID_CACHE(result, str) RUBY_CONST_ID_CACHE(result, str)
                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/cristopherhuarocolivera/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/ruby.h:1727:5: note: expanded from macro 'RUBY_CONST_ID_CACHE'
    }
    ^
byebug.c:198:27: note: ')' token is here
  return call_at(ctx, dc, rb_intern("at_line"), 0, Qnil);
                          ^~~~~~~~~~~~~~~~~~~~
/Users/cristopherhuarocolivera/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/ruby.h:1737:51: note: expanded from macro 'rb_intern'
        __extension__ (CONST_ID_CACHE((ID), (str))) : \
                                                  ^
byebug.c:204:27: error: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts [-Werror,-Wcompound-token-split-by-macro]
  return call_at(ctx, dc, rb_intern("at_tracing"), 0, Qnil);
                          ^~~~~~~~~~~~~~~~~~~~~~~
/Users/cristopherhuarocolivera/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/ruby.h:1737:23: note: expanded from macro 'rb_intern'
        __extension__ (CONST_ID_CACHE((ID), (str))) : \
                      ^
byebug.c:204:27: note: '{' token is here
  return call_at(ctx, dc, rb_intern("at_tracing"), 0, Qnil);
                          ^~~~~~~~~~~~~~~~~~~~~~~
/Users/cristopherhuarocolivera/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/ruby.h:1737:24: note: expanded from macro 'rb_intern'
        __extension__ (CONST_ID_CACHE((ID), (str))) : \
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/cristopherhuarocolivera/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/ruby.h:1730:37: note: expanded from macro 'CONST_ID_CACHE'
#define CONST_ID_CACHE(result, str) RUBY_CONST_ID_CACHE(result, str)
                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/cristopherhuarocolivera/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/ruby.h:1722:5: note: expanded from macro 'RUBY_CONST_ID_CACHE'
    {                                                   \
    ^
byebug.c:204:27: error: '}' and ')' tokens terminating statement expression appear in different macro expansion contexts [-Werror,-Wcompound-token-split-by-macro]
  return call_at(ctx, dc, rb_intern("at_tracing"), 0, Qnil);
                          ^~~~~~~~~~~~~~~~~~~~~~~
/Users/cristopherhuarocolivera/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/ruby.h:1737:24: note: expanded from macro 'rb_intern'
        __extension__ (CONST_ID_CACHE((ID), (str))) : \
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/cristopherhuarocolivera/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/ruby.h:1730:37: note: expanded from macro 'CONST_ID_CACHE'
#define CONST_ID_CACHE(result, str) RUBY_CONST_ID_CACHE(result, str)
                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/cristopherhuarocolivera/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/ruby.h:1727:5: note: expanded from macro 'RUBY_CONST_ID_CACHE'
    }
    ^
byebug.c:204:27: note: ')' token is here
  return call_at(ctx, dc, rb_intern("at_tracing"), 0, Qnil);
                          ^~~~~~~~~~~~~~~~~~~~~~~
/Users/cristopherhuarocolivera/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/ruby.h:1737:51: note: expanded from macro 'rb_intern'
        __extension__ (CONST_ID_CACHE((ID), (str))) : \
                                                  ^
byebug.c:212:27: error: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts [-Werror,-Wcompound-token-split-by-macro]
  return call_at(ctx, dc, rb_intern("at_breakpoint"), 1, breakpoint);
                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/cristopherhuarocolivera/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/ruby.h:1737:23: note: expanded from macro 'rb_intern'
        __extension__ (CONST_ID_CACHE((ID), (str))) : \
                      ^
byebug.c:212:27: note: '{' token is here
  return call_at(ctx, dc, rb_intern("at_breakpoint"), 1, breakpoint);
                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/cristopherhuarocolivera/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/ruby.h:1737:24: note: expanded from macro 'rb_intern'
        __extension__ (CONST_ID_CACHE((ID), (str))) : \
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/cristopherhuarocolivera/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/ruby.h:1730:37: note: expanded from macro 'CONST_ID_CACHE'
#define CONST_ID_CACHE(result, str) RUBY_CONST_ID_CACHE(result, str)
                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/cristopherhuarocolivera/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/ruby.h:1722:5: note: expanded from macro 'RUBY_CONST_ID_CACHE'
    {                                                   \
    ^
byebug.c:212:27: error: '}' and ')' tokens terminating statement expression appear in different macro expansion contexts [-Werror,-Wcompound-token-split-by-macro]
  return call_at(ctx, dc, rb_intern("at_breakpoint"), 1, breakpoint);
                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/cristopherhuarocolivera/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/ruby.h:1737:24: note: expanded from macro 'rb_intern'
        __extension__ (CONST_ID_CACHE((ID), (str))) : \
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/cristopherhuarocolivera/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/ruby.h:1730:37: note: expanded from macro 'CONST_ID_CACHE'
#define CONST_ID_CACHE(result, str) RUBY_CONST_ID_CACHE(result, str)
                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/cristopherhuarocolivera/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/ruby.h:1727:5: note: expanded from macro 'RUBY_CONST_ID_CACHE'
    }
    ^
byebug.c:212:27: note: ')' token is here
  return call_at(ctx, dc, rb_intern("at_breakpoint"), 1, breakpoint);
                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/cristopherhuarocolivera/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/ruby.h:1737:51: note: expanded from macro 'rb_intern'
        __extension__ (CONST_ID_CACHE((ID), (str))) : \
                                                  ^
byebug.c:220:27: error: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts [-Werror,-Wcompound-token-split-by-macro]
  return call_at(ctx, dc, rb_intern("at_catchpoint"), 1, exp);
                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/cristopherhuarocolivera/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/ruby.h:1737:23: note: expanded from macro 'rb_intern'
        __extension__ (CONST_ID_CACHE((ID), (str))) : \
                      ^
byebug.c:220:27: note: '{' token is here
  return call_at(ctx, dc, rb_intern("at_catchpoint"), 1, exp);
                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/cristopherhuarocolivera/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/ruby.h:1737:24: note: expanded from macro 'rb_intern'
        __extension__ (CONST_ID_CACHE((ID), (str))) : \
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/cristopherhuarocolivera/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/ruby.h:1730:37: note: expanded from macro 'CONST_ID_CACHE'
#define CONST_ID_CACHE(result, str) RUBY_CONST_ID_CACHE(result, str)
                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/cristopherhuarocolivera/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/ruby.h:1722:5: note: expanded from macro 'RUBY_CONST_ID_CACHE'
    {                                                   \
    ^
byebug.c:220:27: error: '}' and ')' tokens terminating statement expression appear in different macro expansion contexts [-Werror,-Wcompound-token-split-by-macro]
  return call_at(ctx, dc, rb_intern("at_catchpoint"), 1, exp);
                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/cristopherhuarocolivera/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/ruby.h:1737:24: note: expanded from macro 'rb_intern'
        __extension__ (CONST_ID_CACHE((ID), (str))) : \
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/cristopherhuarocolivera/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/ruby.h:1730:37: note: expanded from macro 'CONST_ID_CACHE'
#define CONST_ID_CACHE(result, str) RUBY_CONST_ID_CACHE(result, str)
                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/cristopherhuarocolivera/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/ruby.h:1727:5: note: expanded from macro 'RUBY_CONST_ID_CACHE'
    }
    ^
byebug.c:220:27: note: ')' token is here
  return call_at(ctx, dc, rb_intern("at_catchpoint"), 1, exp);
                          ^~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/cristopherhuarocolivera/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/ruby.h:1737:51: note: expanded from macro 'rb_intern'
        __extension__ (CONST_ID_CACHE((ID), (str))) : \
                                                  ^
byebug.c:228:27: error: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts [-Werror,-Wcompound-token-split-by-macro]
  return call_at(ctx, dc, rb_intern("at_return"), 1, return_value);
                          ^~~~~~~~~~~~~~~~~~~~~~
/Users/cristopherhuarocolivera/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/ruby.h:1737:23: note: expanded from macro 'rb_intern'
        __extension__ (CONST_ID_CACHE((ID), (str))) : \
                      ^
byebug.c:228:27: note: '{' token is here
  return call_at(ctx, dc, rb_intern("at_return"), 1, return_value);
                          ^~~~~~~~~~~~~~~~~~~~~~
/Users/cristopherhuarocolivera/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/ruby.h:1737:24: note: expanded from macro 'rb_intern'
        __extension__ (CONST_ID_CACHE((ID), (str))) : \
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/cristopherhuarocolivera/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/ruby.h:1730:37: note: expanded from macro 'CONST_ID_CACHE'
#define CONST_ID_CACHE(result, str) RUBY_CONST_ID_CACHE(result, str)
                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/cristopherhuarocolivera/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/ruby.h:1722:5: note: expanded from macro 'RUBY_CONST_ID_CACHE'
    {                                                   \
    ^
byebug.c:228:27: error: '}' and ')' tokens terminating statement expression appear in different macro expansion contexts [-Werror,-Wcompound-token-split-by-macro]
  return call_at(ctx, dc, rb_intern("at_return"), 1, return_value);
                          ^~~~~~~~~~~~~~~~~~~~~~
/Users/cristopherhuarocolivera/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/ruby.h:1737:24: note: expanded from macro 'rb_intern'
        __extension__ (CONST_ID_CACHE((ID), (str))) : \
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/cristopherhuarocolivera/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/ruby.h:1730:37: note: expanded from macro 'CONST_ID_CACHE'
#define CONST_ID_CACHE(result, str) RUBY_CONST_ID_CACHE(result, str)
                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/cristopherhuarocolivera/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/ruby.h:1727:5: note: expanded from macro 'RUBY_CONST_ID_CACHE'
    }
    ^
byebug.c:228:27: note: ')' token is here
  return call_at(ctx, dc, rb_intern("at_return"), 1, return_value);
                          ^~~~~~~~~~~~~~~~~~~~~~
/Users/cristopherhuarocolivera/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/ruby.h:1737:51: note: expanded from macro 'rb_intern'
        __extension__ (CONST_ID_CACHE((ID), (str))) : \
                                                  ^
byebug.c:236:27: error: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts [-Werror,-Wcompound-token-split-by-macro]
  return call_at(ctx, dc, rb_intern("at_end"), 0, Qnil);
                          ^~~~~~~~~~~~~~~~~~~
/Users/cristopherhuarocolivera/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/ruby.h:1737:23: note: expanded from macro 'rb_intern'
        __extension__ (CONST_ID_CACHE((ID), (str))) : \
                      ^
byebug.c:236:27: note: '{' token is here
  return call_at(ctx, dc, rb_intern("at_end"), 0, Qnil);
                          ^~~~~~~~~~~~~~~~~~~
/Users/cristopherhuarocolivera/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/ruby.h:1737:24: note: expanded from macro 'rb_intern'
        __extension__ (CONST_ID_CACHE((ID), (str))) : \
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/cristopherhuarocolivera/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/ruby.h:1730:37: note: expanded from macro 'CONST_ID_CACHE'
#define CONST_ID_CACHE(result, str) RUBY_CONST_ID_CACHE(result, str)
                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/cristopherhuarocolivera/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/ruby.h:1722:5: note: expanded from macro 'RUBY_CONST_ID_CACHE'
    {                                                   \
    ^
byebug.c:236:27: error: '}' and ')' tokens terminating statement expression appear in different macro expansion contexts [-Werror,-Wcompound-token-split-by-macro]
  return call_at(ctx, dc, rb_intern("at_end"), 0, Qnil);
                          ^~~~~~~~~~~~~~~~~~~
/Users/cristopherhuarocolivera/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/ruby.h:1737:24: note: expanded from macro 'rb_intern'
        __extension__ (CONST_ID_CACHE((ID), (str))) : \
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/cristopherhuarocolivera/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/ruby.h:1730:37: note: expanded from macro 'CONST_ID_CACHE'
#define CONST_ID_CACHE(result, str) RUBY_CONST_ID_CACHE(result, str)
                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/cristopherhuarocolivera/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/ruby.h:1727:5: note: expanded from macro 'RUBY_CONST_ID_CACHE'
    }
    ^
byebug.c:236:27: note: ')' token is here
  return call_at(ctx, dc, rb_intern("at_end"), 0, Qnil);
                          ^~~~~~~~~~~~~~~~~~~
/Users/cristopherhuarocolivera/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/ruby.h:1737:51: note: expanded from macro 'rb_intern'
        __extension__ (CONST_ID_CACHE((ID), (str))) : \
                                                  ^
byebug.c:442:35: error: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts [-Werror,-Wcompound-token-split-by-macro]
    rb_ivar_set(raised_exception, rb_intern("@__bb_context"), pm_context);
                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/cristopherhuarocolivera/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/ruby.h:1737:23: note: expanded from macro 'rb_intern'
        __extension__ (CONST_ID_CACHE((ID), (str))) : \
                      ^
byebug.c:442:35: note: '{' token is here
    rb_ivar_set(raised_exception, rb_intern("@__bb_context"), pm_context);
                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/cristopherhuarocolivera/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/ruby.h:1737:24: note: expanded from macro 'rb_intern'
        __extension__ (CONST_ID_CACHE((ID), (str))) : \
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/cristopherhuarocolivera/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/ruby.h:1730:37: note: expanded from macro 'CONST_ID_CACHE'
#define CONST_ID_CACHE(result, str) RUBY_CONST_ID_CACHE(result, str)
                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/cristopherhuarocolivera/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/ruby.h:1722:5: note: expanded from macro 'RUBY_CONST_ID_CACHE'
    {                                                   \
    ^
byebug.c:442:35: error: '}' and ')' tokens terminating statement expression appear in different macro expansion contexts [-Werror,-Wcompound-token-split-by-macro]
    rb_ivar_set(raised_exception, rb_intern("@__bb_context"), pm_context);
                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/cristopherhuarocolivera/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/ruby.h:1737:24: note: expanded from macro 'rb_intern'
        __extension__ (CONST_ID_CACHE((ID), (str))) : \
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/cristopherhuarocolivera/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/ruby.h:1730:37: note: expanded from macro 'CONST_ID_CACHE'
#define CONST_ID_CACHE(result, str) RUBY_CONST_ID_CACHE(result, str)
                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/cristopherhuarocolivera/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/ruby.h:1727:5: note: expanded from macro 'RUBY_CONST_ID_CACHE'
    }
    ^
byebug.c:442:35: note: ')' token is here
    rb_ivar_set(raised_exception, rb_intern("@__bb_context"), pm_context);
                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/cristopherhuarocolivera/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/ruby.h:1737:51: note: expanded from macro 'rb_intern'
        __extension__ (CONST_ID_CACHE((ID), (str))) : \
                                                  ^
byebug.c:560:33: error: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts [-Werror,-Wcompound-token-split-by-macro]
  list = rb_funcall(rb_cThread, rb_intern("list"), 0);
                                ^~~~~~~~~~~~~~~~~
/Users/cristopherhuarocolivera/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/ruby.h:1737:23: note: expanded from macro 'rb_intern'
        __extension__ (CONST_ID_CACHE((ID), (str))) : \
                      ^
byebug.c:560:33: note: '{' token is here
  list = rb_funcall(rb_cThread, rb_intern("list"), 0);
                                ^~~~~~~~~~~~~~~~~
/Users/cristopherhuarocolivera/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/ruby.h:1737:24: note: expanded from macro 'rb_intern'
        __extension__ (CONST_ID_CACHE((ID), (str))) : \
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/cristopherhuarocolivera/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/ruby.h:1730:37: note: expanded from macro 'CONST_ID_CACHE'
#define CONST_ID_CACHE(result, str) RUBY_CONST_ID_CACHE(result, str)
                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/cristopherhuarocolivera/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/ruby.h:1722:5: note: expanded from macro 'RUBY_CONST_ID_CACHE'
    {                                                   \
    ^
byebug.c:560:33: error: '}' and ')' tokens terminating statement expression appear in different macro expansion contexts [-Werror,-Wcompound-token-split-by-macro]
  list = rb_funcall(rb_cThread, rb_intern("list"), 0);
                                ^~~~~~~~~~~~~~~~~
/Users/cristopherhuarocolivera/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/ruby.h:1737:24: note: expanded from macro 'rb_intern'
        __extension__ (CONST_ID_CACHE((ID), (str))) : \
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/cristopherhuarocolivera/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/ruby.h:1730:37: note: expanded from macro 'CONST_ID_CACHE'
#define CONST_ID_CACHE(result, str) RUBY_CONST_ID_CACHE(result, str)
                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/cristopherhuarocolivera/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/ruby.h:1727:5: note: expanded from macro 'RUBY_CONST_ID_CACHE'
    }
    ^
byebug.c:560:33: note: ')' token is here
  list = rb_funcall(rb_cThread, rb_intern("list"), 0);
                                ^~~~~~~~~~~~~~~~~
/Users/cristopherhuarocolivera/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/ruby.h:1737:51: note: expanded from macro 'rb_intern'
        __extension__ (CONST_ID_CACHE((ID), (str))) : \
                                                  ^
byebug.c:900:12: error: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts [-Werror,-Wcompound-token-split-by-macro]
  idPuts = rb_intern("puts");
           ^~~~~~~~~~~~~~~~~
/Users/cristopherhuarocolivera/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/ruby.h:1737:23: note: expanded from macro 'rb_intern'
        __extension__ (CONST_ID_CACHE((ID), (str))) : \
                      ^
byebug.c:900:12: note: '{' token is here
  idPuts = rb_intern("puts");
           ^~~~~~~~~~~~~~~~~
/Users/cristopherhuarocolivera/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/ruby.h:1737:24: note: expanded from macro 'rb_intern'
        __extension__ (CONST_ID_CACHE((ID), (str))) : \
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/cristopherhuarocolivera/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/ruby.h:1730:37: note: expanded from macro 'CONST_ID_CACHE'
#define CONST_ID_CACHE(result, str) RUBY_CONST_ID_CACHE(result, str)
                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/cristopherhuarocolivera/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/ruby.h:1722:5: note: expanded from macro 'RUBY_CONST_ID_CACHE'
    {                                                   \
    ^
byebug.c:900:12: error: '}' and ')' tokens terminating statement expression appear in different macro expansion contexts [-Werror,-Wcompound-token-split-by-macro]
  idPuts = rb_intern("puts");
           ^~~~~~~~~~~~~~~~~
/Users/cristopherhuarocolivera/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/ruby.h:1737:24: note: expanded from macro 'rb_intern'
        __extension__ (CONST_ID_CACHE((ID), (str))) : \
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/cristopherhuarocolivera/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/ruby.h:1730:37: note: expanded from macro 'CONST_ID_CACHE'
#define CONST_ID_CACHE(result, str) RUBY_CONST_ID_CACHE(result, str)
                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/cristopherhuarocolivera/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/ruby.h:1727:5: note: expanded from macro 'RUBY_CONST_ID_CACHE'
    }
    ^
byebug.c:900:12: note: ')' token is here
  idPuts = rb_intern("puts");
           ^~~~~~~~~~~~~~~~~
/Users/cristopherhuarocolivera/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/ruby.h:1737:51: note: expanded from macro 'rb_intern'
        __extension__ (CONST_ID_CACHE((ID), (str))) : \
                                                  ^
byebug.c:901:13: error: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts [-Werror,-Wcompound-token-split-by-macro]
  idEmpty = rb_intern("empty?");
            ^~~~~~~~~~~~~~~~~~~
/Users/cristopherhuarocolivera/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/ruby.h:1737:23: note: expanded from macro 'rb_intern'
        __extension__ (CONST_ID_CACHE((ID), (str))) : \
                      ^
byebug.c:901:13: note: '{' token is here
  idEmpty = rb_intern("empty?");
            ^~~~~~~~~~~~~~~~~~~
/Users/cristopherhuarocolivera/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/ruby.h:1737:24: note: expanded from macro 'rb_intern'
        __extension__ (CONST_ID_CACHE((ID), (str))) : \
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/cristopherhuarocolivera/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/ruby.h:1730:37: note: expanded from macro 'CONST_ID_CACHE'
#define CONST_ID_CACHE(result, str) RUBY_CONST_ID_CACHE(result, str)
                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/cristopherhuarocolivera/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/ruby.h:1722:5: note: expanded from macro 'RUBY_CONST_ID_CACHE'
    {                                                   \
    ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [byebug.o] Error 1

make failed, exit code 2

Gem files will remain installed in /Users/cristopherhuarocolivera/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/byebug-8.2.1 for inspection.
Results logged to /Users/cristopherhuarocolivera/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/extensions/-darwin-21/2.3.0-static/byebug-8.2.1/gem_mak

@swapnils19
Copy link

Got it working with these -

brew install llvm@11
export CC=/usr/local/opt/llvm@11/bin/clang
export CCX=/usr/local/opt/llvm@11/bin/clang

@Cristopheer96
Copy link
Author

Got it working with these -

brew install llvm@11
export CC=/usr/local/opt/llvm@11/bin/clang
export CCX=/usr/local/opt/llvm@11/bin/clang

i tried this, but without success :/

@Cristopheer96
Copy link
Author

this work's for me:
I run export PATH="/opt/homebrew/opt/llvm@11/bin:$PATH"

@AlexeiZenin
Copy link

Running the solutions here I still get 3 errors on Ruby 2.7.0 for an Intel Mac.

One of the errors:

context.c:190:20: error: incompatible function pointer types passing 'VALUE (struct call_with_inspection_data *)' (aka 'unsigned long (struct call_with_inspection_data *)') to parameter of type 'VALUE (*)(VALUE)' (aka 'unsigned long (*)(unsigned long)') [-Werror,-Wincompatible-function-pointer-types]
  return rb_ensure(open_debug_inspector, (VALUE) data, close_debug_inspector,
                   ^~~~~~~~~~~~~~~~~~~~

@AlexeiZenin
Copy link

For anyone stumbling on this just update the gem to the latest version and try that. It ended up working for me (since this is just for debugging won't really affect your app and not worth to figure out how to use all these C compilers for the older versions)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants