Project

General

Profile

Actions

Bug #18754

closed

Compiling from Source Ruby on Mac M1 Failing

Added by saad (saad naveed) over 3 years ago. Updated over 3 years ago.

Status:
Third Party's Issue
Assignee:
-
Target version:
-
[ruby-core:108399]

Description

Hello,

I'm attempting to build Ruby on my Mac M1, and it seems to be failing, and I can't find anything to figure out why it might be. Not sure if this actually a bug, or maybe something someone can help me with.

I followed the steps listed in the README here: https://github.com/ruby/ruby

My base ruby version: ruby 3.0.2p107 (2021-07-07 revision 0db68f0233) [arm64-darwin21]

When I ran make check, I keep getting this error:

โžœ  ruby git:(master) โœ— make check
	BASERUBY = /Users/saad/.rbenv/shims/ruby --disable=gems
	CC = clang
	LD = clang
	LDSHARED = clang -dynamiclib
	CFLAGS = -fdeclspec -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Werror=deprecated-declarations -Werror=division-by-zero -Werror=div-by-zero -Werror=implicit-function-declaration -Werror=implicit-int -Werror=misleading-indentation -Werror=pointer-arith -Werror=shorten-64-to-32 -Werror=write-strings -Werror=old-style-definition -Wmissing-noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wunused-variable -Werror=extra-tokens -Werror=undef -std=gnu99  -pipe
	XCFLAGS = -D_FORTIFY_SOURCE=2 -fstack-protector-strong -fno-strict-overflow -DRUBY_DEVEL=1 -fvisibility=hidden -DRUBY_EXPORT -fPIE -I. -I.ext/include/arm64-darwin21 -I./include -I. -I./enc/unicode/14.0.0
	CPPFLAGS = -I/opt/homebrew/opt/postgresql@12/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT
	DLDFLAGS = -L/opt/homebrew/opt/postgresql@12/lib -Wl,-undefined,dynamic_lookup -Wl,-multiply_defined,suppress -fstack-protector-strong -Wl,-pie -framework CoreFoundation
	SOLIBS = -lpthread -ldl -lobjc
	LANG = en_US.UTF-8
	LC_ALL =
	LC_CTYPE =
	MFLAGS =
Apple clang version 13.1.6 (clang-1316.0.21.2.3)
Target: arm64-apple-darwin21.3.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
./revision.h unchanged
generating encdb.h
encdb.h unchanged
generating enc.mk
making srcs under enc
make[1]: Nothing to be done for `srcs'.
generating transdb.h
transdb.h unchanged
generating makefiles ext/configure-ext.mk
ext/configure-ext.mk unchanged
configuring psych
/Users/saad/dev/ruby/tool/extlibs.rb:7:in `require': cannot load such file -- digest (LoadError)
	from /Users/saad/dev/ruby/tool/extlibs.rb:7:in `<top (required)>'
	from /Users/saad/dev/ruby/ext/psych/extconf.rb:24:in `require_relative'
	from /Users/saad/dev/ruby/ext/psych/extconf.rb:24:in `<top (required)>'
	from ./ext/extmk.rb:217:in `load'
	from ./ext/extmk.rb:217:in `block in extmake'
	from /Users/saad/dev/ruby/lib/mkmf.rb:324:in `open'
	from ./ext/extmk.rb:213:in `extmake'
	from ./ext/extmk.rb:577:in `block in <main>'
	from ./ext/extmk.rb:573:in `each'
	from ./ext/extmk.rb:573:in `<main>'
make[1]: *** [ext/psych/exts.mk] Error 1
make: *** [exts.mk] Error 2

When I print out the $LOAD_PATH, I'm only getting the following:

.
/Users/saad/dev/ruby/lib
/Users/saad/dev/ruby

Anyone have any ideas?

Thanks!

Actions #1

Updated by saad (saad naveed) over 3 years ago

  • Description updated (diff)

Updated by chrisseaton (Chris Seaton) over 3 years ago

You probably need to install libyaml-dev.

I don't know why the error message is so bad. Shouldn't it be picked up during an extconf test?

Updated by saad (saad naveed) over 3 years ago

chrisseaton (Chris Seaton) wrote in #note-2:

You probably need to install libyaml-dev.

I don't know why the error message is so bad. Shouldn't it be picked up during an extconf test?

Thanks, Chris! Incredible. That was the issue, and I assumed it was something totally different. How'd you know that was the issue?

Updated by chrisseaton (Chris Seaton) over 3 years ago

Faced the same issue myself, Jemma Issroff pointed out the solution to me. Also the fact that it's compiling psych is a hint there's something wrong with YAML.

https://github.com/ruby/psych/issues/552

Actions #5

Updated by hsbt (Hiroshi SHIBATA) over 3 years ago

  • Status changed from Open to Third Party's Issue
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0