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

"use of undeclared identifier 'RUBY_FUNCTION_NAME_STRING'" when trying to install ruby 3.2.6 & 3.3.7, but 3.4.1 works without issue. #504

Open
Lasvad opened this issue Feb 9, 2025 · 4 comments
Labels

Comments

@Lasvad
Copy link

Lasvad commented Feb 9, 2025

Hi all,

Trying to figure out what's going on with my ruby install on a fresh M3 MacBook Air.

Whenever I try to install 3.2.2 (Currently used in my project), 3.2.6, 3.3.7, or 3.4.1 I get the same error when installing,,,

In file included from debug.c:27: ./vm_callinfo.h:216:16: error: use of undeclared identifier 'RUBY_FUNCTION_NAME_STRING' 216 | if (debug) rp(ci);

I've tried removing and reinstalling CommandLineTools, a number of PATH updates, brew installing dependencies but nothing seems to work. Its the first time I'm installing Ruby-install on a M-series chip, but generally on my previous intel machines (unsure if its related to arch but worth noting) Ruby-install just works.

I was planning to try and install openssl1.1 but look like this has been disabled

brew install [email protected] ==> Downloading https://formulae.brew.sh/api/formula.jws.json ==> Downloading https://formulae.brew.sh/api/cask.jws.json Error: [email protected] has been disabled because it is not supported upstream! It was disabled on 2024-10-24.
so I can't verify if that fixes it, currently have OpenSSL 3.4.0.

What's also strange is that when I tried installing 3.4.1, it worked. My plan currently is to just upgrade my project to this new version but I'm trying to understand what's happening and how to fix it for any future occurrences.

Please let me know what else I can provide to help understand/troubleshoot this issue.

@terard
Copy link

terard commented Feb 10, 2025

I had a similar issue on a fresh install. I did some brew installs and it seemed to fix it. I first confirmed it was not a ruby-install issue by trying to install without ruby-install. I had the same issues.

I'm not totally sure which brew packages were needed for the fix, but the last one that got it working was gdbm.

What does brew list give you?

@joetor5
Copy link

joetor5 commented Feb 16, 2025

Having the same issue on a MacBook Air M1 running macOS Sequoia 15.3.1 when trying to install 3.1.2. No issues with 3.4.1 as well.

compiling compile.c
compiling cont.c
compiling complex.c
compiling debug.c
compiling debug_counter.c
In file included from compile.c:40:
./vm_callinfo.h:175:9: error: use of undeclared identifier 'RUBY_FUNCTION_NAME_STRING'
  175 |         rp(ci);
      |         ^
./internal.h:94:72: note: expanded from macro 'rp'
   94 | #define rp(obj) rb_obj_info_dump_loc((VALUE)(obj), __FILE__, __LINE__, RUBY_FUNCTION_NAME_STRING)
      |                                                                        ^
In file included from compile.c:40:
./vm_callinfo.h:216:16: error: use of undeclared identifier 'RUBY_FUNCTION_NAME_STRING'
  216 |     if (debug) rp(ci);
      |                ^
./internal.h:94:72: note: expanded from macro 'rp'
   94 | #define rp(obj) rb_obj_info_dump_loc((VALUE)(obj), __FILE__, __LINE__, RUBY_FUNCTION_NAME_STRING)
      |                                                                        ^
In file included from debug.c:27:
./vm_callinfo.h:175:9: error: use of undeclared identifier 'RUBY_FUNCTION_NAME_STRING'
  175 |         rp(ci);
      |         ^
./internal.h:94:72: note: expanded from macro 'rp'
   94 | #define rp(obj) rb_obj_info_dump_loc((VALUE)(obj), __FILE__, __LINE__, RUBY_FUNCTION_NAME_STRING)
      |                                                                        ^
In file included from debug.c:27:
./vm_callinfo.h:216:16: error: use of undeclared identifier 'RUBY_FUNCTION_NAME_STRING'
  216 |     if (debug) rp(ci);
      |                ^
./internal.h:94:72: note: expanded from macro 'rp'
   94 | #define rp(obj) rb_obj_info_dump_loc((VALUE)(obj), __FILE__, __LINE__, RUBY_FUNCTION_NAME_STRING)
      |                                                                        ^
2 errors generated.
compiling dir.c
make: *** [debug.o] Error 1
make: *** Waiting for unfinished jobs....
2 errors generated.
make: *** [compile.o] Error 1
!!! Compiling ruby 3.1.2 failed!

My brew list:

==> Formulae
autoconf	ca-certificates	jemalloc	m4		ruby-install
automake	chruby		libffi		openssl@3	xz
bison		gmp		libyaml		readline	zlib

==> Casks

I'm able to install 3.1.2 on a Raspberry Pi 3 Model B Plus Rev 1.3 (aarch64) running Debian GNU/Linux 12.9 (bookworm).

@joetor5
Copy link

joetor5 commented Feb 16, 2025

I was able to compile/install manually without error as documented in https://github.com/postmodern/chruby/wiki/Ruby:

cd ruby-3.1.2
./configure \
    --prefix="$HOME/.rubies/ruby-3.1.2" \
    --with-gmp-dir="$(brew --prefix gmp)" \
    --with-libyaml-dir="$(brew --prefix libyaml)" \
    --with-openssl-dir="$(brew --prefix openssl)" \
    --with-readline-dir="$(brew --prefix readline)" \
    --with-zlib-dir="$(brew --prefix zlib)" \
    --with-opt-dir="$(brew --prefix jemalloc)" \
    --with-jemalloc
make
make install

@postmodern
Copy link
Owner

@joetor5 ruby-install doesn't use the other --with-*-dir= options but instead passes in a single --with-opt-dir=DIR1:DIR2:... option. This might be another bug in CRuby's ./configure not setting the --with-*-dir options based on values already passed in via --with-opt-dir. I'll probably also need to adjust the logic in configure_ruby to use the named --with-*-dir= options.

The fact that 3.4.1 works, implies this issue was eventually fixed upstream.

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

No branches or pull requests

4 participants