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

Trouble installing on MacOS 13.1 + Ruby 3.2.0 (via rbenv) #14

Open
gobijan opened this issue Jan 4, 2023 · 10 comments
Open

Trouble installing on MacOS 13.1 + Ruby 3.2.0 (via rbenv) #14

gobijan opened this issue Jan 4, 2023 · 10 comments

Comments

@gobijan
Copy link
Contributor

gobijan commented Jan 4, 2023

Hi, happy new year and thanks for making this gem :)

I was trying to install it on MacOS 13.1 (22C65) with installed and agreed xcode commandline tools and rbenv ruby 3.2.0 (2022-12-25 revision a528908271) [arm64-darwin22]

Unfortunately I can't get it to install with Ruby 3.2.0. However I can install using Ruby 3.1.2.
Any clue how to fix this?

Here is the output:

❯ gem install readapt                                                                                                   
Building native extensions. This could take a while...
ERROR:  Error installing readapt:
	ERROR: Failed to build gem native extension.

    current directory: /Users/bijan/.rbenv/versions/3.2.0/lib/ruby/gems/3.2.0/gems/readapt-1.4.4/ext/readapt
/Users/bijan/.rbenv/versions/3.2.0/bin/ruby -I /Users/bijan/.rbenv/versions/3.2.0/lib/ruby/site_ruby/3.2.0 extconf.rb
creating Makefile

current directory: /Users/bijan/.rbenv/versions/3.2.0/lib/ruby/gems/3.2.0/gems/readapt-1.4.4/ext/readapt
make DESTDIR\= sitearchdir\=./.gem.20230104-50495-5f0q9k sitelibdir\=./.gem.20230104-50495-5f0q9k clean

current directory: /Users/bijan/.rbenv/versions/3.2.0/lib/ruby/gems/3.2.0/gems/readapt-1.4.4/ext/readapt
make DESTDIR\= sitearchdir\=./.gem.20230104-50495-5f0q9k sitelibdir\=./.gem.20230104-50495-5f0q9k
compiling breakpoints.c
compiling frame.c
frame.c:131:57: error: use of undeclared identifier 'rb_cData'
    c_Frame = rb_define_class_under(m_Readapt, "Frame", rb_cData);
                                                        ^
1 error generated.
make: *** [frame.o] Error 1

make failed, exit code 2

Gem files will remain installed in /Users/bijan/.rbenv/versions/3.2.0/lib/ruby/gems/3.2.0/gems/readapt-1.4.4 for inspection.
Results logged to /Users/bijan/.rbenv/versions/3.2.0/lib/ruby/gems/3.2.0/extensions/arm64-darwin-22/3.2.0/readapt-1.4.4/gem_make.out
@zzJZzz
Copy link

zzJZzz commented Feb 17, 2023

@gobijan Hi, How did you end up solving this? I am having a similar error just on WSL? Thank you.

@gobijan
Copy link
Contributor Author

gobijan commented Feb 20, 2023

I didn't tbh.
I had no time looking deeper into this and use RubyMine for now for convenient debugging.

@zzJZzz
Copy link

zzJZzz commented Feb 20, 2023

Thanks for the reply. I'll put this on the backburner for now.

@gobijan
Copy link
Contributor Author

gobijan commented Feb 20, 2023

I just had a look into the code.
Problem is the rb_cData that was deprecated. It has been removed in ruby 3.1 and therefore this code needs to be changed all the way to support newer Ruby versions.

See: https://bugs.ruby-lang.org/issues/18433

@gobijan
Copy link
Contributor Author

gobijan commented Feb 20, 2023

Could be enough to simply replace rb_cData with rb_cObject.
I'll try and might create a PR if successful.

@gobijan
Copy link
Contributor Author

gobijan commented Feb 20, 2023

#15

@zzJZzz give it a try and let me know if it works for you.

@gobijan
Copy link
Contributor Author

gobijan commented Feb 20, 2023

Works for me(™)

@megatux
Copy link

megatux commented Oct 9, 2023

same here on MacOS Sonoma and Ruby MRI 3.2.2. The above workaround PR seems to work here, too.

@castwide
Copy link
Owner

Fix released in v2.0.0.

@NigelSwinson
Copy link

I confirm the rb_cData/rb_cObject issue is resolved.

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

5 participants