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

Byebug install error #280

Closed
katawura opened this issue Jul 3, 2016 · 29 comments
Closed

Byebug install error #280

katawura opened this issue Jul 3, 2016 · 29 comments

Comments

@katawura
Copy link

katawura commented Jul 3, 2016

l am currently trying to install byebug with my rails project and keep getting this error

An error occurred while installing byebug (9.0.5), and Bundler cannot continue.
Make sure that `gem install byebug -v '9.0.5'` succeeds before bundling.

Any idea why this would be?

@dmitry
Copy link

dmitry commented Aug 10, 2016

@katawura please include compilation log.

@notcreativeusername
Copy link

Same issue for me...

prompt$ gem install byebug -v '9.0.5'
Building native extensions. This could take a while...
ERROR: Error installing byebug:
ERROR: Failed to build gem native extension.

/Users/myid/.rvm/rubies/ruby-2.2.4/bin/ruby -r ./siteconf20160929-41835-10wdbb2.rb extconf.rb

creating Makefile

make "DESTDIR=" clean

make "DESTDIR="
compiling breakpoint.c
couldn't understand kern.osversion `15.6.0'
cc1: error: unrecognized command line option "-Wdivision-by-zero"
make: *** [breakpoint.o] Error 1

make failed, exit code 2

Gem files will remain installed in /Users/myid/.rvm/gems/ruby-2.2.4/gems/byebug-9.0.5 for inspection.
Results logged to /Users/myid/.rvm/gems/ruby-2.2.4/extensions/x86_64-darwin-15/2.2.0/byebug-9.0.5/gem_make.out

@dmitry
Copy link

dmitry commented Sep 29, 2016

@notcreativeusername can you please include /Users/myid/.rvm/gems/ruby-2.2.4/extensions/x86_64-darwin-15/2.2.0/byebug-9.0.5/gem_make.out here ?

@notcreativeusername
Copy link

Not sure it will help much.... and FYI to get around this error I ran sudo gem install byebug -v '9.0.5' and it didn't throw this error. Not ideal but it works.

/Users/myid/.rvm/rubies/ruby-2.2.4/bin/ruby -r ./siteconf20160929-41835-10wdbb2.rb extconf.rb
creating Makefile

make "DESTDIR=" clean

make "DESTDIR="
compiling breakpoint.c
couldn't understand kern.osversion `15.6.0'
cc1: error: unrecognized command line option "-Wdivision-by-zero"
make: *** [breakpoint.o] Error 1

make failed, exit code 2

@dmitry
Copy link

dmitry commented Sep 29, 2016

Looks like it only happens on Mac OS.

So sudo gem install byebug -v '9.0.5' successfully compiled byebug?

@dmitry
Copy link

dmitry commented Sep 29, 2016

sudo which gcc and which gcc have the same paths?

@notcreativeusername
Copy link

looks like it installed ok

prompt$ sudo gem install byebug -v '9.0.5'
Password:
Fetching: byebug-9.0.5.gem (100%)
Building native extensions. This could take a while...
Successfully installed byebug-9.0.5
Parsing documentation for byebug-9.0.5
Installing ri documentation for byebug-9.0.5
Done installing documentation for byebug after 22 seconds
1 gem installed

and yes it appears they have the same path

prompt$ sudo which gcc
Password:
/usr/bin/gcc
prompt$ which gcc
/usr/bin/gcc

@dmitry
Copy link

dmitry commented Sep 29, 2016

I'm not a Mac user, but looks like the only solution is to use:

CC=llvm-gcc gem install byebug -v '9.0.5'

@notcreativeusername
Copy link

I tried that before and it didn't work unless I typed something wrong.....

prompt$ CC=llvm-gcc gem install byebug -v '9.0.5'
Building native extensions. This could take a while...
ERROR: Error installing byebug:
ERROR: Failed to build gem native extension.

/Users/myid/.rvm/rubies/ruby-2.2.4/bin/ruby -r ./siteconf20160929-41761-hgkxot.rb extconf.rb

creating Makefile

make "DESTDIR=" clean

make "DESTDIR="
compiling breakpoint.c
couldn't understand kern.osversion `15.6.0'
cc1: error: unrecognized command line option "-Wdivision-by-zero"
make: *** [breakpoint.o] Error 1

make failed, exit code 2

Gem files will remain installed in /Users/myid/.rvm/gems/ruby-2.2.4/gems/byebug-9.0.5 for inspection.
Results logged to /Users/myid/.rvm/gems/ruby-2.2.4/extensions/x86_64-darwin-15/2.2.0/byebug-9.0.5/gem_make.out

@deivid-rodriguez
Copy link
Owner

Try a clean install of another ruby. If that works I think this is a problem with your current ruby. If it doesn't it might be a problem in byebug. For example,

rvm install 2.2.5
rvm use 2.2.5
gem install byebug

Speaking from memory since I don't use rvm.

@deivid-rodriguez
Copy link
Owner

@notcreativeusername anything?

@harishsr
Copy link

harishsr commented Dec 8, 2017

I had the same problem. Installing XCode Command Line Tools fixed it.

@deivid-rodriguez
Copy link
Owner

Closing since it's an old issue probably unrelated to byebug, thanks for the feedback!

@ljromero
Copy link

Confirmed @deivid-rodriguez! Upgrading rvm fixes this issue.

rvm/rvm#4371 (comment)

@mjj4685
Copy link

mjj4685 commented Apr 4, 2021

This worked for me!

sudo gem install byebug -v '11.1.3'

Fetching byebug-11.1.3.gem
Building native extensions. This could take a while...
Successfully installed byebug-11.1.3
Parsing documentation for byebug-11.1.3
Installing ri documentation for byebug-11.1.3
Done installing documentation for byebug after 22 seconds
1 gem installed

@hipertracker
Copy link

I does NOT work on the latest stable macOS 11.4

gem install byebug -v '11.1.3'
❯ gem install byebug -v '11.1.3'
Building native extensions. This could take a while...
ERROR:  Error installing byebug:
	ERROR: Failed to build gem native extension.

    current directory: /Users/hipertracker/.frum/versions/3.0.2/lib/ruby/gems/3.0.0/gems/byebug-11.1.3/ext/byebug
/Users/hipertracker/.frum/versions/3.0.2/bin/ruby -I /Users/hipertracker/.frum/versions/3.0.2/lib/ruby/3.0.0 -r ./siteconf20210717-27404-hz68wf.rb extconf.rb
creating Makefile

current directory: /Users/hipertracker/.frum/versions/3.0.2/lib/ruby/gems/3.0.0/gems/byebug-11.1.3/ext/byebug
make DESTDIR\= clean

current directory: /Users/hipertracker/.frum/versions/3.0.2/lib/ruby/gems/3.0.0/gems/byebug-11.1.3/ext/byebug
make DESTDIR\=
compiling breakpoint.c
In file included from breakpoint.c:1:
In file included from ./byebug.h:4:
In file included from /Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby.h:38:
In file included from /Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/ruby.h:23:
In file included from /Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/defines.h:73:
In file included from /Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/backward/2/attributes.h:43:
In file included from /Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/internal/attr/pure.h:25:
/Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/assert.h:132:1: error: '__declspec' attributes are not enabled; use '-fdeclspec' or '-fms-extensions' to enable support for __declspec attributes
RBIMPL_ATTR_NORETURN()
^
/Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/internal/attr/noreturn.h:29:33: note: expanded from macro 'RBIMPL_ATTR_NORETURN'
# define RBIMPL_ATTR_NORETURN() __declspec(noreturn)
                                ^
In file included from breakpoint.c:1:
In file included from ./byebug.h:4:
In file included from /Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby.h:38:
In file included from /Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/ruby.h:24:
In file included from /Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/internal/anyargs.h:77:
/Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/internal/intern/vm.h:64:1: error: '__declspec' attributes are not enabled; use '-fdeclspec' or '-fms-extensions' to enable support for __declspec attributes
RBIMPL_ATTR_NORETURN()
^
/Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/internal/attr/noreturn.h:29:33: note: expanded from macro 'RBIMPL_ATTR_NORETURN'
# define RBIMPL_ATTR_NORETURN() __declspec(noreturn)
                                ^
In file included from breakpoint.c:1:
In file included from ./byebug.h:4:
In file included from /Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby.h:38:
In file included from /Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/ruby.h:25:
In file included from /Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/internal/arithmetic.h:23:
In file included from /Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/internal/arithmetic/char.h:23:
In file included from /Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/internal/arithmetic/int.h:26:
/Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/internal/arithmetic/long.h:70:1: error: '__declspec' attributes are not enabled; use '-fdeclspec' or '-fms-extensions' to enable support for __declspec attributes
RBIMPL_ATTR_NORETURN()
^
/Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/internal/attr/noreturn.h:29:33: note: expanded from macro 'RBIMPL_ATTR_NORETURN'
# define RBIMPL_ATTR_NORETURN() __declspec(noreturn)
                                ^
In file included from breakpoint.c:1:
In file included from ./byebug.h:4:
In file included from /Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby.h:38:
In file included from /Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/ruby.h:25:
In file included from /Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/internal/arithmetic.h:23:
In file included from /Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/internal/arithmetic/char.h:29:
In file included from /Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/internal/core/rstring.h:28:
/Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/internal/core/rbasic.h:46:14: error: expected parameter declarator
RUBY_ALIGNAS(SIZEOF_VALUE)
             ^
/Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/internal/value.h:41:23: note: expanded from macro 'SIZEOF_VALUE'
# define SIZEOF_VALUE SIZEOF_LONG
                      ^
/Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/x86_64-darwin20/ruby/config.h:64:21: note: expanded from macro 'SIZEOF_LONG'
#define SIZEOF_LONG 8
                    ^
In file included from breakpoint.c:1:
In file included from ./byebug.h:4:
In file included from /Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby.h:38:
In file included from /Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/ruby.h:25:
In file included from /Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/internal/arithmetic.h:23:
In file included from /Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/internal/arithmetic/char.h:29:
In file included from /Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/internal/core/rstring.h:28:
/Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/internal/core/rbasic.h:46:14: error: expected ')'
/Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/internal/value.h:41:23: note: expanded from macro 'SIZEOF_VALUE'
# define SIZEOF_VALUE SIZEOF_LONG
                      ^
/Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/x86_64-darwin20/ruby/config.h:64:21: note: expanded from macro 'SIZEOF_LONG'
#define SIZEOF_LONG 8
                    ^
/Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/internal/core/rbasic.h:46:1: note: to match this '('
RUBY_ALIGNAS(SIZEOF_VALUE)
^
/Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/backward/2/stdalign.h:27:22: note: expanded from macro 'RUBY_ALIGNAS'
#define RUBY_ALIGNAS RBIMPL_ALIGNAS
                     ^
/Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/internal/stdalign.h:66:44: note: expanded from macro 'RBIMPL_ALIGNAS'
# define RBIMPL_ALIGNAS(_) __declspec(align(_))
                                           ^
In file included from breakpoint.c:1:
In file included from ./byebug.h:4:
In file included from /Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby.h:38:
In file included from /Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/ruby.h:25:
In file included from /Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/internal/arithmetic.h:23:
In file included from /Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/internal/arithmetic/char.h:29:
In file included from /Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/internal/core/rstring.h:28:
/Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/internal/core/rbasic.h:47:1: error: expected function body after function declarator
RBasic {
^
/Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/internal/core/rbasic.h:82:23: error: incomplete definition of type 'struct RBasic'
    return RBASIC(obj)->klass;
           ~~~~~~~~~~~^
/Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/internal/core/rbasic.h:82:12: note: forward declaration of 'struct RBasic'
    return RBASIC(obj)->klass;
           ^
/Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/internal/core/rbasic.h:34:50: note: expanded from macro 'RBASIC'
#define RBASIC(obj)          RBIMPL_CAST((struct RBasic *)(obj))
                                                 ^
In file included from breakpoint.c:1:
In file included from ./byebug.h:4:
In file included from /Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby.h:38:
In file included from /Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/ruby.h:25:
In file included from /Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/internal/arithmetic.h:23:
In file included from /Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/internal/arithmetic/char.h:29:
In file included from /Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/internal/core/rstring.h:30:
In file included from /Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/internal/fl_type.h:35:
/Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/internal/value_type.h:157:28: error: incomplete definition of type 'struct RBasic'
    VALUE ret = RBASIC(obj)->flags & RUBY_T_MASK;
                ~~~~~~~~~~~^
/Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/internal/value_type.h:157:17: note: forward declaration of 'struct RBasic'
    VALUE ret = RBASIC(obj)->flags & RUBY_T_MASK;
                ^
/Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/internal/core/rbasic.h:34:50: note: expanded from macro 'RBASIC'
#define RBASIC(obj)          RBIMPL_CAST((struct RBasic *)(obj))
                                                 ^
In file included from breakpoint.c:1:
In file included from ./byebug.h:4:
In file included from /Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby.h:38:
In file included from /Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/ruby.h:25:
In file included from /Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/internal/arithmetic.h:23:
In file included from /Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/internal/arithmetic/char.h:29:
In file included from /Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/internal/core/rstring.h:30:
/Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/internal/fl_type.h:237:23: error: incomplete definition of type 'struct RBasic'
    return RBASIC(obj)->flags & flags;
           ~~~~~~~~~~~^
/Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/internal/fl_type.h:237:12: note: forward declaration of 'struct RBasic'
    return RBASIC(obj)->flags & flags;
           ^
/Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/internal/core/rbasic.h:34:50: note: expanded from macro 'RBASIC'
#define RBASIC(obj)          RBIMPL_CAST((struct RBasic *)(obj))
                                                 ^
In file included from breakpoint.c:1:
In file included from ./byebug.h:4:
In file included from /Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby.h:38:
In file included from /Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/ruby.h:25:
In file included from /Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/internal/arithmetic.h:23:
In file included from /Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/internal/arithmetic/char.h:29:
In file included from /Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/internal/core/rstring.h:30:
/Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/internal/fl_type.h:285:1: error: '__declspec' attributes are not enabled; use '-fdeclspec' or '-fms-extensions' to enable support for __declspec attributes
RBIMPL_ATTR_NOALIAS()
^
/Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/internal/attr/noalias.h:53:32: note: expanded from macro 'RBIMPL_ATTR_NOALIAS'
# define RBIMPL_ATTR_NOALIAS() __declspec(noalias)
                               ^
In file included from breakpoint.c:1:
In file included from ./byebug.h:4:
In file included from /Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby.h:38:
In file included from /Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/ruby.h:25:
In file included from /Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/internal/arithmetic.h:23:
In file included from /Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/internal/arithmetic/char.h:29:
In file included from /Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/internal/core/rstring.h:30:
/Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/internal/fl_type.h:288:30: warning: declaration of 'struct RBasic' will not be visible outside of this function [-Wvisibility]
rbimpl_fl_set_raw_raw(struct RBasic *obj, VALUE flags)
                             ^
/Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/internal/fl_type.h:290:8: error: incomplete definition of type 'struct RBasic'
    obj->flags |= flags;
    ~~~^
/Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/internal/fl_type.h:288:30: note: forward declaration of 'struct RBasic'
rbimpl_fl_set_raw_raw(struct RBasic *obj, VALUE flags)
                             ^
/Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/internal/fl_type.h:298:27: warning: incompatible pointer types passing 'struct RBasic *' to parameter of type 'struct RBasic *' [-Wincompatible-pointer-types]
    rbimpl_fl_set_raw_raw(RBASIC(obj), flags);
                          ^~~~~~~~~~~
/Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/internal/core/rbasic.h:34:30: note: expanded from macro 'RBASIC'
#define RBASIC(obj)          RBIMPL_CAST((struct RBasic *)(obj))
                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/internal/cast.h:33:28: note: expanded from macro 'RBIMPL_CAST'
# define RBIMPL_CAST(expr) (expr)
                           ^~~~~~
/Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/internal/fl_type.h:288:38: note: passing argument to parameter 'obj' here
rbimpl_fl_set_raw_raw(struct RBasic *obj, VALUE flags)
                                     ^
/Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/internal/fl_type.h:310:1: error: '__declspec' attributes are not enabled; use '-fdeclspec' or '-fms-extensions' to enable support for __declspec attributes
RBIMPL_ATTR_NOALIAS()
^
/Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/internal/attr/noalias.h:53:32: note: expanded from macro 'RBIMPL_ATTR_NOALIAS'
# define RBIMPL_ATTR_NOALIAS() __declspec(noalias)
                               ^
In file included from breakpoint.c:1:
In file included from ./byebug.h:4:
In file included from /Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby.h:38:
In file included from /Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/ruby.h:25:
In file included from /Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/internal/arithmetic.h:23:
In file included from /Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/internal/arithmetic/char.h:29:
In file included from /Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/internal/core/rstring.h:30:
/Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/internal/fl_type.h:313:32: warning: declaration of 'struct RBasic' will not be visible outside of this function [-Wvisibility]
rbimpl_fl_unset_raw_raw(struct RBasic *obj, VALUE flags)
                               ^
/Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/internal/fl_type.h:315:8: error: incomplete definition of type 'struct RBasic'
    obj->flags &= ~flags;
    ~~~^
/Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/internal/fl_type.h:313:32: note: forward declaration of 'struct RBasic'
rbimpl_fl_unset_raw_raw(struct RBasic *obj, VALUE flags)
                               ^
/Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/internal/fl_type.h:323:29: warning: incompatible pointer types passing 'struct RBasic *' to parameter of type 'struct RBasic *' [-Wincompatible-pointer-types]
    rbimpl_fl_unset_raw_raw(RBASIC(obj), flags);
                            ^~~~~~~~~~~
/Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/internal/core/rbasic.h:34:30: note: expanded from macro 'RBASIC'
#define RBASIC(obj)          RBIMPL_CAST((struct RBasic *)(obj))
                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/internal/cast.h:33:28: note: expanded from macro 'RBIMPL_CAST'
# define RBIMPL_CAST(expr) (expr)
                           ^~~~~~
/Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/internal/fl_type.h:313:40: note: passing argument to parameter 'obj' here
rbimpl_fl_unset_raw_raw(struct RBasic *obj, VALUE flags)
                                       ^
/Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/internal/fl_type.h:335:1: error: '__declspec' attributes are not enabled; use '-fdeclspec' or '-fms-extensions' to enable support for __declspec attributes
RBIMPL_ATTR_NOALIAS()
^
/Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/internal/attr/noalias.h:53:32: note: expanded from macro 'RBIMPL_ATTR_NOALIAS'
# define RBIMPL_ATTR_NOALIAS() __declspec(noalias)
                               ^
In file included from breakpoint.c:1:
In file included from ./byebug.h:4:
In file included from /Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby.h:38:
In file included from /Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/ruby.h:25:
In file included from /Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/internal/arithmetic.h:23:
In file included from /Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/internal/arithmetic/char.h:29:
In file included from /Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/internal/core/rstring.h:30:
/Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/internal/fl_type.h:338:34: warning: declaration of 'struct RBasic' will not be visible outside of this function [-Wvisibility]
rbimpl_fl_reverse_raw_raw(struct RBasic *obj, VALUE flags)
                                 ^
/Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/internal/fl_type.h:340:8: error: incomplete definition of type 'struct RBasic'
    obj->flags ^= flags;
    ~~~^
/Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/internal/fl_type.h:338:34: note: forward declaration of 'struct RBasic'
rbimpl_fl_reverse_raw_raw(struct RBasic *obj, VALUE flags)
                                 ^
/Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/internal/fl_type.h:348:31: warning: incompatible pointer types passing 'struct RBasic *' to parameter of type 'struct RBasic *' [-Wincompatible-pointer-types]
    rbimpl_fl_reverse_raw_raw(RBASIC(obj), flags);
                              ^~~~~~~~~~~
/Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/internal/core/rbasic.h:34:30: note: expanded from macro 'RBASIC'
#define RBASIC(obj)          RBIMPL_CAST((struct RBasic *)(obj))
                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/internal/cast.h:33:28: note: expanded from macro 'RBIMPL_CAST'
# define RBIMPL_CAST(expr) (expr)
                           ^~~~~~
/Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/internal/fl_type.h:338:42: note: passing argument to parameter 'obj' here
rbimpl_fl_reverse_raw_raw(struct RBasic *obj, VALUE flags)
                                         ^
/Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/internal/fl_type.h:465:43: error: incomplete definition of type 'struct RBasic'
        if (RBASIC_CLASS(x) && !(RBASIC(x)->flags & RUBY_FL_SINGLETON)) {
                                 ~~~~~~~~~^
/Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/internal/fl_type.h:465:34: note: forward declaration of 'struct RBasic'
        if (RBASIC_CLASS(x) && !(RBASIC(x)->flags & RUBY_FL_SINGLETON)) {
                                 ^
/Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/internal/core/rbasic.h:34:50: note: expanded from macro 'RBASIC'
#define RBASIC(obj)          RBIMPL_CAST((struct RBasic *)(obj))
                                                 ^
In file included from breakpoint.c:1:
In file included from ./byebug.h:4:
In file included from /Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby.h:38:
In file included from /Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/ruby.h:25:
In file included from /Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/internal/arithmetic.h:23:
In file included from /Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/internal/arithmetic/char.h:29:
/Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/internal/core/rstring.h:74:19: error: field has incomplete type 'struct RBasic'
    struct RBasic basic;
                  ^
/Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/internal/core/rstring.h:74:12: note: forward declaration of 'struct RBasic'
    struct RBasic basic;
           ^
/Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/internal/core/rstring.h:109:26: error: incomplete definition of type 'struct RBasic'
    VALUE f = RBASIC(str)->flags;
              ~~~~~~~~~~~^
/Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/internal/core/rstring.h:74:12: note: forward declaration of 'struct RBasic'
    struct RBasic basic;
           ^
In file included from breakpoint.c:1:
In file included from ./byebug.h:4:
In file included from /Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby.h:38:
In file included from /Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/ruby.h:26:
In file included from /Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/internal/core.h:23:
/Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/internal/core/rarray.h:88:19: error: field has incomplete type 'struct RBasic'
    struct RBasic basic;
                  ^
/Users/hipertracker/.frum/versions/3.0.2/include/ruby-3.0.0/ruby/internal/core/rstring.h:74:12: note: forward declaration of 'struct RBasic'
    struct RBasic basic;
           ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
6 warnings and 20 errors generated.
make: *** [breakpoint.o] Error 1

make failed, exit code 2

Gem files will remain installed in /Users/hipertracker/.frum/versions/3.0.2/lib/ruby/gems/3.0.0/gems/byebug-11.1.3 for inspection.
Results logged to /Users/hipertracker/.frum/versions/3.0.2/lib/ruby/gems/3.0.0/extensions/x86_64-darwin-20/3.0.0-static/byebug-11.1.3/gem_make.out

@orthodoX
Copy link

orthodoX commented Sep 3, 2021

I can confirm it is not working on Ruby 3.0.1 running on Apple M1, macOS 11.5.2

@tubsandcans
Copy link

I'm also unable to install this extension (or sqlite3 1.4.2) using Ruby 3.0.0 or 3.0.2 on macOS (Intel) 11.5.2.

@timtim22
Copy link

guys, any update on this? I am also not able to install it on Apple M1, Big Sur

@mbpod10
Copy link

mbpod10 commented Oct 25, 2021

I am also having issues, running Big Sur. Same problem as above.

@jaw6
Copy link

jaw6 commented Oct 30, 2021

I definitely don't have this 100% but in case this is useful to someone else, here's what I did to get this working.

Background: I have an Intel MacBookPro on Catalina (10.15.7).

I was getting the above error message and the messages seemed to be coming from C, which made me think it could be a C-compiler problem.

So, with homebrew, I was able to install a newer clang/llvm:

brew install llvm

And then use it:

export CC=/usr/local/opt/llvm/bin/clang

After this I was able to install byebug. I'm not aware of anything else I did, so I think this made the difference.

In case it's helpful, here are the versions of clang before/after:

❯ /usr/bin/clang -v
Apple clang version 11.0.3 (clang-1103.0.32.62)
Target: x86_64-apple-darwin19.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

❯ /usr/local/opt/llvm/bin/clang -v
Homebrew clang version 13.0.0
Target: x86_64-apple-darwin19.6.0
Thread model: posix
InstalledDir: /usr/local/opt/llvm/bin

@cheradenine
Copy link

This might help - have not tried it yet to confirm..

#825 comment 903260365

@ronaldtse
Copy link

I also encountered this error (Apple M1, Monterey), and it worked after setting export CC=clang.

@cyangOL
Copy link

cyangOL commented Jan 8, 2022

I got it working with below steps on big sur:
Reinstall commandline tools

sudo rm -rf /Library/Developer/CommandLineTools
xcode-select --install

Install llvm

brew install llvm

Set cc and ccx to llvm from homebrew
export CC=/usr/local/opt/llvm/bin/clang
export CCX=/usr/local/opt/llvm/bin/clang

@akahn
Copy link

akahn commented Apr 12, 2022

Thank you. This solution worked for me. However, on my setup, Homebrew installed the clang executable in a different directory, and it was only necessary to set CC. So, for me, this was enough:

brew install llvm
export CC=/opt/homebrew/opt/llvm/bin/clang

@dmlo
Copy link

dmlo commented Jun 15, 2022

For the people coming here from search engines... Installing older versions of byebug (in my case, 4.0.5) required the installation of llvm@11 and then

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

Oh, the joys of legacy development.

@bbulpett
Copy link

Using Ventura, I had the same issue and tried the above solutions. I tried them in the embedded IDE terminal (vs code) and gem install showed same error - even when restarting embedded terminal. Then I switched to the OG mac terminal app and gem install byebug and subsequent bundle install completed without issue.

@patbl
Copy link

patbl commented Jun 18, 2024

I get an error when I try to install llvm@11:

$ brew install llvm@11
Error: llvm@11 has been disabled because it is a versioned formula!

But the following worked for me on Sonoma 14.5 and Ruby 3.0.5:

brew install llvm@12
export CC=/usr/local/opt/llvm@12/bin/clang # Edit: better is `export CC=$(brew --prefix llvm@12)/bin/clang`; see next comment
gem install byebug -v '9.0.6'

llvm@16 did not work. I'm not sure at which point between 12 and 16 this broke.

@ishan123456789
Copy link

adapted answer if your address for brew packages is different:

brew install llvm@12
export CC=$(brew --prefix llvm@12)/bin/clang
gem install byebug -v '9.0.6'

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