Skip to content

Instantly share code, notes, and snippets.

@yatsu
Last active July 13, 2023 19:36
Show Gist options
  • Star 24 You must be signed in to star a gist
  • Fork 6 You must be signed in to fork a gist
  • Save yatsu/b62f07ef9ff3ae1e0e2bf9a00b8742b6 to your computer and use it in GitHub Desktop.
Save yatsu/b62f07ef9ff3ae1e0e2bf9a00b8742b6 to your computer and use it in GitHub Desktop.
Install ruby-1.8.7 with rbenv on macOS Catalina (10.15)
#!/bin/sh
# 1) Install Xcode 11
# 2) Install command line tools: `xcode-select --install`
# 3) Install HomeBrew
# 4) brew tap cartr/qt4 && brew install cartr/qt4/openssl@1.0 subversion rbenv
# 5) Setup rbenv
# 6) Run this command
PKG_CONFIG_PATH="$(brew --prefix cartr/qt4/openssl@1.0)/lib/pkgconfig" \
CFLAGS="-O2 -fno-tree-dce -fno-optimize-sibling-calls -I$(brew --prefix cartr/qt4/openssl@1.0)/include" \
LDFLAGS="-L$(brew --prefix cartr/qt4/openssl@1.0)/lib" \
rbenv install 1.8.7-p375
# If your macOS is older than 10.15, see the history of this gist.
@yatsu
Copy link
Author

yatsu commented Jan 20, 2021

I have this error when running on MacOC Catalina 10.15.4

eval.c:7288:2: error: implicit declaration of function 'rb_thread_join' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        rb_thread_join(owner->thread, -1.0);
        ^
eval.c:7288:2: note: did you mean 'rb_thread_main'?
./intern.h:236:7: note: 'rb_thread_main' declared here
VALUE rb_thread_main _((void));
      ^

Using gcc-6 or other versions may help.
See old version of this script in Revisions page.

(I don't have Catalina now.)

@maxat-mansurov-jetbrains

I have this error when running on MacOC Catalina 10.15.4

eval.c:7288:2: error: implicit declaration of function 'rb_thread_join' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        rb_thread_join(owner->thread, -1.0);
        ^
eval.c:7288:2: note: did you mean 'rb_thread_main'?
./intern.h:236:7: note: 'rb_thread_main' declared here
VALUE rb_thread_main _((void));
      ^

Adding -Wno-error=implicit-function-declaration to CFLAGS has helped me (MacOS Monterey 12.3.1).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment