Repository navigation
Can't install psych 5.0.1 in macOS on Apple Silicon #600
Copy link
Copy link
Closed
Description
I have libyaml from Homebrew installed. It works when running Ruby with Rosetta 2 (arch -x86_64 /bin/zsh).
Issue seems to be checking for yaml_get_version() in -lyaml... no for arm64.
Details:
arm64: gem install --verbose psych
arm64 $ gem install --verbose psych
HEAD https://index.rubygems.org/
200 OK
GET https://index.rubygems.org/info/psych
200 OK
GET https://index.rubygems.org/quick/Marshal.4.8/psych-5.0.1.gemspec.rz
200 OK
GET https://index.rubygems.org/info/stringio
200 OK
/Users/dentarg/.arm64_rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/.gitignore
/Users/dentarg/.arm64_rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/Gemfile
/Users/dentarg/.arm64_rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/LICENSE
/Users/dentarg/.arm64_rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/Mavenfile
/Users/dentarg/.arm64_rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/README.md
/Users/dentarg/.arm64_rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/Rakefile
/Users/dentarg/.arm64_rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/bin/console
/Users/dentarg/.arm64_rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/bin/setup
/Users/dentarg/.arm64_rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/ext/psych/depend
/Users/dentarg/.arm64_rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/ext/psych/extconf.rb
/Users/dentarg/.arm64_rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/ext/psych/psych.c
/Users/dentarg/.arm64_rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/ext/psych/psych.h
/Users/dentarg/.arm64_rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/ext/psych/psych_emitter.c
/Users/dentarg/.arm64_rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/ext/psych/psych_emitter.h
/Users/dentarg/.arm64_rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/ext/psych/psych_parser.c
/Users/dentarg/.arm64_rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/ext/psych/psych_parser.h
/Users/dentarg/.arm64_rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/ext/psych/psych_to_ruby.c
/Users/dentarg/.arm64_rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/ext/psych/psych_to_ruby.h
/Users/dentarg/.arm64_rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/ext/psych/psych_yaml_tree.c
/Users/dentarg/.arm64_rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/ext/psych/psych_yaml_tree.h
/Users/dentarg/.arm64_rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/lib/psych.rb
/Users/dentarg/.arm64_rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/lib/psych/class_loader.rb
/Users/dentarg/.arm64_rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/lib/psych/coder.rb
/Users/dentarg/.arm64_rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/lib/psych/core_ext.rb
/Users/dentarg/.arm64_rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/lib/psych/exception.rb
/Users/dentarg/.arm64_rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/lib/psych/handler.rb
/Users/dentarg/.arm64_rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/lib/psych/handlers/document_stream.rb
/Users/dentarg/.arm64_rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/lib/psych/handlers/recorder.rb
/Users/dentarg/.arm64_rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/lib/psych/json/ruby_events.rb
/Users/dentarg/.arm64_rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/lib/psych/json/stream.rb
/Users/dentarg/.arm64_rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/lib/psych/json/tree_builder.rb
/Users/dentarg/.arm64_rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/lib/psych/json/yaml_events.rb
/Users/dentarg/.arm64_rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/lib/psych/nodes.rb
/Users/dentarg/.arm64_rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/lib/psych/nodes/alias.rb
/Users/dentarg/.arm64_rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/lib/psych/nodes/document.rb
/Users/dentarg/.arm64_rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/lib/psych/nodes/mapping.rb
/Users/dentarg/.arm64_rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/lib/psych/nodes/node.rb
/Users/dentarg/.arm64_rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/lib/psych/nodes/scalar.rb
/Users/dentarg/.arm64_rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/lib/psych/nodes/sequence.rb
/Users/dentarg/.arm64_rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/lib/psych/nodes/stream.rb
/Users/dentarg/.arm64_rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/lib/psych/omap.rb
/Users/dentarg/.arm64_rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/lib/psych/parser.rb
/Users/dentarg/.arm64_rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/lib/psych/scalar_scanner.rb
/Users/dentarg/.arm64_rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/lib/psych/set.rb
/Users/dentarg/.arm64_rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/lib/psych/stream.rb
/Users/dentarg/.arm64_rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/lib/psych/streaming.rb
/Users/dentarg/.arm64_rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/lib/psych/syntax_error.rb
/Users/dentarg/.arm64_rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/lib/psych/tree_builder.rb
/Users/dentarg/.arm64_rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/lib/psych/versions.rb
/Users/dentarg/.arm64_rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/lib/psych/visitors.rb
/Users/dentarg/.arm64_rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/lib/psych/visitors/depth_first.rb
/Users/dentarg/.arm64_rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/lib/psych/visitors/emitter.rb
/Users/dentarg/.arm64_rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/lib/psych/visitors/json_tree.rb
/Users/dentarg/.arm64_rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/lib/psych/visitors/to_ruby.rb
/Users/dentarg/.arm64_rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/lib/psych/visitors/visitor.rb
/Users/dentarg/.arm64_rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/lib/psych/visitors/yaml_tree.rb
/Users/dentarg/.arm64_rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/lib/psych/y.rb
/Users/dentarg/.arm64_rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/psych.gemspec
Building native extensions. This could take a while...
current directory: /Users/dentarg/.arm64_rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/ext/psych
["/Users/dentarg/.arm64_rubies/3.1.2/bin/ruby", "-I", "/Users/dentarg/.arm64_rubies/3.1.2/lib/ruby/site_ruby/3.1.0", "extconf.rb"]
checking for yaml.h... yes
checking for yaml_get_version() in -lyaml... no
libyaml not found
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/Users/dentarg/.arm64_rubies/3.1.2/bin/$(RUBY_BASE_NAME)
--with-libyaml-source-dir
--without-libyaml-source-dir
--with-yaml-0.1-dir
--without-yaml-0.1-dir
--with-yaml-0.1-include
--without-yaml-0.1-include=${yaml-0.1-dir}/include
--with-yaml-0.1-lib
--without-yaml-0.1-lib=${yaml-0.1-dir}/lib
--with-yaml-0.1-config
--without-yaml-0.1-config
--with-pkg-config
--without-pkg-config
--with-libyaml-dir
--without-libyaml-dir
--with-libyaml-include
--without-libyaml-include=${libyaml-dir}/include
--with-libyaml-lib
--without-libyaml-lib=${libyaml-dir}/lib
--with-yaml-dir
--without-yaml-dir
--with-yaml-include
--without-yaml-include=${yaml-dir}/include
--with-yaml-lib
--without-yaml-lib=${yaml-dir}/lib
--with-yamllib
--without-yamllib
ERROR: Error installing psych:
ERROR: Failed to build gem native extension.
current directory: /Users/dentarg/.arm64_rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/ext/psych
/Users/dentarg/.arm64_rubies/3.1.2/bin/ruby -I /Users/dentarg/.arm64_rubies/3.1.2/lib/ruby/site_ruby/3.1.0 extconf.rb
Building has failed. See above output for more information on the failure.
To see why this extension failed to compile, please check the mkmf.log which can be found here:
/Users/dentarg/.arm64_rubies/3.1.2/lib/ruby/gems/3.1.0/extensions/arm64-darwin-21/3.1.0/psych-5.0.1/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in /Users/dentarg/.arm64_rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1 for inspection.
Results logged to /Users/dentarg/.arm64_rubies/3.1.2/lib/ruby/gems/3.1.0/extensions/arm64-darwin-21/3.1.0/psych-5.0.1/gem_make.out
cat mkmf.log
arm64 $ cat /Users/dentarg/.arm64_rubies/3.1.2/lib/ruby/gems/3.1.0/extensions/arm64-darwin-21/3.1.0/psych-5.0.1/mkmf.log
DYLD_FALLBACK_LIBRARY_PATH=.:/Users/dentarg/.arm64_rubies/3.1.2/lib pkg-config --exists yaml-0.1
DYLD_FALLBACK_LIBRARY_PATH=.:/Users/dentarg/.arm64_rubies/3.1.2/lib pkg-config --libs yaml-0.1 |
=> "-L/opt/homebrew/Cellar/libyaml/0.2.5/lib -lyaml\n"
DYLD_FALLBACK_LIBRARY_PATH=.:/Users/dentarg/.arm64_rubies/3.1.2/lib "clang -o conftest -I/Users/dentarg/.arm64_rubies/3.1.2/include/ruby-3.1.0/arm64-darwin21 -I/Users/dentarg/.arm64_rubies/3.1.2/include/ruby-3.1.0/ruby/backward -I/Users/dentarg/.arm64_rubies/3.1.2/include/ruby-3.1.0 -I. -I/Users/dentarg/.arm64_rubies/3.1.2/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -fdeclspec -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wold-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 -Wextra-tokens -Wundef -fno-common -pipe conftest.c -L. -L/Users/dentarg/.arm64_rubies/3.1.2/lib -L. -L/Users/dentarg/.arm64_rubies/3.1.2/lib -fstack-protector-strong -L/usr/local/lib -lruby.3.1 "
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main(int argc, char **argv)
4: {
5: return !!argv[argc];
6: }
/* end */
DYLD_FALLBACK_LIBRARY_PATH=.:/Users/dentarg/.arm64_rubies/3.1.2/lib "clang -o conftest -I/Users/dentarg/.arm64_rubies/3.1.2/include/ruby-3.1.0/arm64-darwin21 -I/Users/dentarg/.arm64_rubies/3.1.2/include/ruby-3.1.0/ruby/backward -I/Users/dentarg/.arm64_rubies/3.1.2/include/ruby-3.1.0 -I. -I/Users/dentarg/.arm64_rubies/3.1.2/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -fdeclspec -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wold-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 -Wextra-tokens -Wundef -fno-common -pipe conftest.c -L. -L/Users/dentarg/.arm64_rubies/3.1.2/lib -L. -L/Users/dentarg/.arm64_rubies/3.1.2/lib -fstack-protector-strong -L/usr/local/lib -lruby.3.1 -L/opt/homebrew/Cellar/libyaml/0.2.5/lib -lyaml "
ld: warning: ignoring file /usr/local/lib/libyaml.dylib, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main(int argc, char **argv)
4: {
5: return !!argv[argc];
6: }
/* end */
DYLD_FALLBACK_LIBRARY_PATH=.:/Users/dentarg/.arm64_rubies/3.1.2/lib pkg-config --cflags-only-I yaml-0.1 |
=> "-I/opt/homebrew/Cellar/libyaml/0.2.5/include\n"
DYLD_FALLBACK_LIBRARY_PATH=.:/Users/dentarg/.arm64_rubies/3.1.2/lib pkg-config --cflags-only-other yaml-0.1 |
=> "\n"
DYLD_FALLBACK_LIBRARY_PATH=.:/Users/dentarg/.arm64_rubies/3.1.2/lib pkg-config --libs-only-l yaml-0.1 |
=> "-lyaml\n"
package configuration for yaml-0.1
incflags: -I/opt/homebrew/Cellar/libyaml/0.2.5/include
cflags:
ldflags: -L/opt/homebrew/Cellar/libyaml/0.2.5/lib
libs: -lyaml
find_header: checking for yaml.h... -------------------- yes
DYLD_FALLBACK_LIBRARY_PATH=.:/Users/dentarg/.arm64_rubies/3.1.2/lib "clang -I/Users/dentarg/.arm64_rubies/3.1.2/include/ruby-3.1.0/arm64-darwin21 -I/Users/dentarg/.arm64_rubies/3.1.2/include/ruby-3.1.0/ruby/backward -I/Users/dentarg/.arm64_rubies/3.1.2/include/ruby-3.1.0 -I. -I/opt/homebrew/Cellar/libyaml/0.2.5/include -I/Users/dentarg/.arm64_rubies/3.1.2/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -fdeclspec -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wold-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 -Wextra-tokens -Wundef -fno-common -pipe -c conftest.c"
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <yaml.h>
/* end */
--------------------
find_library: checking for yaml_get_version() in -lyaml... -------------------- no
DYLD_FALLBACK_LIBRARY_PATH=.:/Users/dentarg/.arm64_rubies/3.1.2/lib "clang -o conftest -I/Users/dentarg/.arm64_rubies/3.1.2/include/ruby-3.1.0/arm64-darwin21 -I/Users/dentarg/.arm64_rubies/3.1.2/include/ruby-3.1.0/ruby/backward -I/Users/dentarg/.arm64_rubies/3.1.2/include/ruby-3.1.0 -I. -I/opt/homebrew/Cellar/libyaml/0.2.5/include -I/Users/dentarg/.arm64_rubies/3.1.2/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -fdeclspec -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wold-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 -Wextra-tokens -Wundef -fno-common -pipe conftest.c -L. -L/Users/dentarg/.arm64_rubies/3.1.2/lib -L. -L/Users/dentarg/.arm64_rubies/3.1.2/lib -fstack-protector-strong -L/usr/local/lib -L/opt/homebrew/Cellar/libyaml/0.2.5/lib -lyaml -lruby.3.1 -lyaml -lyaml "
conftest.c:14:57: error: use of undeclared identifier 'yaml_get_version'
int t(void) { void ((*volatile p)()); p = (void ((*)()))yaml_get_version; return !p; }
^
1 error generated.
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: /*top*/
4: extern int t(void);
5: int main(int argc, char **argv)
6: {
7: if (argc > 1000000) {
8: int (* volatile tp)(void)=(int (*)(void))&t;
9: printf("%d", (*tp)());
10: }
11:
12: return !!argv[argc];
13: }
14: int t(void) { void ((*volatile p)()); p = (void ((*)()))yaml_get_version; return !p; }
/* end */
DYLD_FALLBACK_LIBRARY_PATH=.:/Users/dentarg/.arm64_rubies/3.1.2/lib "clang -o conftest -I/Users/dentarg/.arm64_rubies/3.1.2/include/ruby-3.1.0/arm64-darwin21 -I/Users/dentarg/.arm64_rubies/3.1.2/include/ruby-3.1.0/ruby/backward -I/Users/dentarg/.arm64_rubies/3.1.2/include/ruby-3.1.0 -I. -I/opt/homebrew/Cellar/libyaml/0.2.5/include -I/Users/dentarg/.arm64_rubies/3.1.2/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -fdeclspec -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wdivision-by-zero -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wshorten-64-to-32 -Wwrite-strings -Wold-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 -Wextra-tokens -Wundef -fno-common -pipe conftest.c -L. -L/Users/dentarg/.arm64_rubies/3.1.2/lib -L. -L/Users/dentarg/.arm64_rubies/3.1.2/lib -fstack-protector-strong -L/usr/local/lib -L/opt/homebrew/Cellar/libyaml/0.2.5/lib -lyaml -lruby.3.1 -lyaml -lyaml "
ld: warning: ignoring file /usr/local/lib/libyaml.dylib, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
Undefined symbols for architecture arm64:
"_yaml_get_version", referenced from:
_t in conftest-fa07a3.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: /*top*/
4: extern int t(void);
5: int main(int argc, char **argv)
6: {
7: if (argc > 1000000) {
8: int (* volatile tp)(void)=(int (*)(void))&t;
9: printf("%d", (*tp)());
10: }
11:
12: return !!argv[argc];
13: }
14: extern void yaml_get_version();
15: int t(void) { yaml_get_version(); return 0; }
/* end */
--------------------
arm64 $ uname -m -r -s ; brew info libyaml
Darwin 21.6.0 arm64
==> libyaml: stable 0.2.5 (bottled)
YAML Parser
https://github.com/yaml/libyaml
/opt/homebrew/Cellar/libyaml/0.2.5 (10 files, 353KB) *
Poured from bottle on 2022-09-12 at 13:06:35
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/libyaml.rb
License: MIT
==> Dependencies
Build: autoconf ✔, automake ✘, libtool ✔x86_64: gem install --verbose psych
intel $ gem install --verbose psych
HEAD https://index.rubygems.org/
200 OK
GET https://index.rubygems.org/info/psych
200 OK
GET https://index.rubygems.org/info/stringio
200 OK
Downloading gem psych-5.0.1.gem
GET https://index.rubygems.org/gems/psych-5.0.1.gem
Fetching psych-5.0.1.gem
200 OK
/Users/dentarg/.rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/.gitignore
/Users/dentarg/.rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/Gemfile
/Users/dentarg/.rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/LICENSE
/Users/dentarg/.rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/Mavenfile
/Users/dentarg/.rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/README.md
/Users/dentarg/.rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/Rakefile
/Users/dentarg/.rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/bin/console
/Users/dentarg/.rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/bin/setup
/Users/dentarg/.rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/ext/psych/depend
/Users/dentarg/.rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/ext/psych/extconf.rb
/Users/dentarg/.rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/ext/psych/psych.c
/Users/dentarg/.rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/ext/psych/psych.h
/Users/dentarg/.rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/ext/psych/psych_emitter.c
/Users/dentarg/.rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/ext/psych/psych_emitter.h
/Users/dentarg/.rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/ext/psych/psych_parser.c
/Users/dentarg/.rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/ext/psych/psych_parser.h
/Users/dentarg/.rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/ext/psych/psych_to_ruby.c
/Users/dentarg/.rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/ext/psych/psych_to_ruby.h
/Users/dentarg/.rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/ext/psych/psych_yaml_tree.c
/Users/dentarg/.rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/ext/psych/psych_yaml_tree.h
/Users/dentarg/.rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/lib/psych.rb
/Users/dentarg/.rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/lib/psych/class_loader.rb
/Users/dentarg/.rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/lib/psych/coder.rb
/Users/dentarg/.rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/lib/psych/core_ext.rb
/Users/dentarg/.rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/lib/psych/exception.rb
/Users/dentarg/.rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/lib/psych/handler.rb
/Users/dentarg/.rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/lib/psych/handlers/document_stream.rb
/Users/dentarg/.rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/lib/psych/handlers/recorder.rb
/Users/dentarg/.rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/lib/psych/json/ruby_events.rb
/Users/dentarg/.rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/lib/psych/json/stream.rb
/Users/dentarg/.rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/lib/psych/json/tree_builder.rb
/Users/dentarg/.rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/lib/psych/json/yaml_events.rb
/Users/dentarg/.rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/lib/psych/nodes.rb
/Users/dentarg/.rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/lib/psych/nodes/alias.rb
/Users/dentarg/.rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/lib/psych/nodes/document.rb
/Users/dentarg/.rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/lib/psych/nodes/mapping.rb
/Users/dentarg/.rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/lib/psych/nodes/node.rb
/Users/dentarg/.rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/lib/psych/nodes/scalar.rb
/Users/dentarg/.rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/lib/psych/nodes/sequence.rb
/Users/dentarg/.rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/lib/psych/nodes/stream.rb
/Users/dentarg/.rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/lib/psych/omap.rb
/Users/dentarg/.rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/lib/psych/parser.rb
/Users/dentarg/.rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/lib/psych/scalar_scanner.rb
/Users/dentarg/.rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/lib/psych/set.rb
/Users/dentarg/.rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/lib/psych/stream.rb
/Users/dentarg/.rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/lib/psych/streaming.rb
/Users/dentarg/.rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/lib/psych/syntax_error.rb
/Users/dentarg/.rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/lib/psych/tree_builder.rb
/Users/dentarg/.rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/lib/psych/versions.rb
/Users/dentarg/.rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/lib/psych/visitors.rb
/Users/dentarg/.rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/lib/psych/visitors/depth_first.rb
/Users/dentarg/.rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/lib/psych/visitors/emitter.rb
/Users/dentarg/.rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/lib/psych/visitors/json_tree.rb
/Users/dentarg/.rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/lib/psych/visitors/to_ruby.rb
/Users/dentarg/.rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/lib/psych/visitors/visitor.rb
/Users/dentarg/.rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/lib/psych/visitors/yaml_tree.rb
/Users/dentarg/.rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/lib/psych/y.rb
/Users/dentarg/.rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/psych.gemspec
Building native extensions. This could take a while...
current directory: /Users/dentarg/.rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/ext/psych
["/Users/dentarg/.rubies/3.1.2/bin/ruby", "-I", "/Users/dentarg/.rubies/3.1.2/lib/ruby/3.1.0", "-r", "./siteconf20221213-26874-7qq7kx.rb", "extconf.rb"]
checking for yaml.h... yes
checking for yaml_get_version() in -lyaml... yes
creating Makefile
current directory: /Users/dentarg/.rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/ext/psych
["make", "DESTDIR=", "clean"]
cd libyaml && /Library/Developer/CommandLineTools/usr/bin/make clean
/bin/sh: line 0: cd: libyaml: No such file or directory
make: [clean-so] Error 1 (ignored)
current directory: /Users/dentarg/.rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/ext/psych
["make", "DESTDIR="]
compiling psych.c
compiling psych_emitter.c
compiling psych_parser.c
compiling psych_to_ruby.c
compiling psych_yaml_tree.c
linking shared-object psych.bundle
ld: warning: -undefined dynamic_lookup may not work with chained fixups
current directory: /Users/dentarg/.rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/ext/psych
["make", "DESTDIR=", "install"]
/usr/bin/install -c -m 0755 psych.bundle ./.gem.20221213-26874-ayv8x1
current directory: /Users/dentarg/.rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/ext/psych
/Users/dentarg/.rubies/3.1.2/bin/ruby -I /Users/dentarg/.rubies/3.1.2/lib/ruby/3.1.0 -r ./siteconf20221213-26874-7qq7kx.rb extconf.rb
current directory: /Users/dentarg/.rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/ext/psych
make DESTDIR\= clean
current directory: /Users/dentarg/.rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/ext/psych
make DESTDIR\=
current directory: /Users/dentarg/.rubies/3.1.2/lib/ruby/gems/3.1.0/gems/psych-5.0.1/ext/psych
make DESTDIR\= install
Successfully installed psych-5.0.1
1 gem installedintel $ uname -m -r -s ; brew info libyaml
Darwin 21.6.0 x86_64
==> libyaml: stable 0.2.5 (bottled)
YAML Parser
https://github.com/yaml/libyaml
/usr/local/Cellar/libyaml/0.2.5 (10 files, 331.3KB) *
Poured from bottle on 2022-09-12 at 13:06:06
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/libyaml.rb
License: MIT
==> Dependencies
Build: autoconf ✔, automake ✘, libtool ✘Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity
hsbt commentedon Dec 12, 2022
I could install psych on Apple Silicon.
dentarg commentedon Dec 12, 2022
Yes,
3.2.0-preview3works for me too with arm64. Should it not work on Ruby 3.1.2?3.2.0-preview3:
gem install --verbose psychhsbt commentedon Dec 13, 2022
I recommend to use Ruby 3.1.3 because 3.1.2 is not working correctly with Ventura/Xcode14 and Apple Silicon.
dentarg commentedon Dec 13, 2022
The failure is the same with Ruby 3.1.3 and Apple Silicon (+ I'm not using Ventura; this is macOS 12.6.1)
hsbt commentedon Dec 13, 2022
There is no idea to resolve it. Maybe it related with
--with-yaml-diror other options.It seems your environmental issue.
jejacks0n commentedon Dec 13, 2022
Literally just ran into this same issue on Ventura, M1. With ruby 3.0.5p211, and ruby 3.1.3p185
libyaml appears to be available...
And I can install version ~4 of psych.
But psych version ~5 isn't installable.
And in the
mkmf.log:Interestingly, I see a similar issue when trying to install ruby 3.2.0.rc1, where I was going to check as well:
EDIT: Maybe I'm not seeing the same thing. It looks like for me libyaml yaml.h is just not being found, and I've tried providing it in a couple different ways when trying to build the native extension.
dentarg commentedon Dec 13, 2022
@hsbt It works if I do
brew uninstall libyamlfor x86_64I noticed this line from
mkmf.logposted above:ld: warning: ignoring file /usr/local/lib/libyaml.dylib, building for macOS-arm64 but attempting to link with file built for macOS-x86_64I think this should just work as it does work using
3.2.0-preview3whenlibyamlis installed for both arm64 and x86_64Is there some recent change to
mkmf.rbthat should be backported?Sairav commentedon Dec 16, 2022
I was facing the same issue ->
I believe after
psychadded a runtime dependency onstringiofrom ver5.0.0starting December 5th 2022 , we are facing the issue. If I rollback to psych4.0.6, it's working fine for me.hsbt commentedon Dec 16, 2022
@Sairav No, It's different issue. You should install
libyaml-devfor resolving it.hsbt commentedon Dec 16, 2022
@dentarg I don't know what changes of
mkmfrelated your issue.Sairav commentedon Dec 16, 2022
Thanks @hsbt , my issue was resolved by installing
libyaml-devel, working with latest verpsych 5.0.1.If it helps anyone , I was running
Oracle Linux 7 Slim, command used -colby-swandale commentedon Dec 21, 2022
I've run into this same issue. Apple Silicon with fresh install MacOS Ventura, with latest Ruby & XCode
hsbt commentedon Dec 21, 2022
@colby-swandale Can you try with
gem i paych -- --with-yaml-dir=$(brew --prefix libyaml)?chriskol commentedon Dec 22, 2022
Don't have an M1/silicon but getting the same thing on my MBP
iiiw commentedon Dec 22, 2022
brew reinstall libyamlworked for me (M2, MacOS Ventura, ruby 3.1.3p185)chriskol commentedon Dec 22, 2022
This worked! Thanks!
FRedwuSong commentedon Dec 31, 2022
Hi ~ Happy New Year
I facing the same issue as @jejacks0n, when I use asdf to install ruby 3.2.0.
I facing the same issue as @colby-swandale , when I
gem install psych.screenshoot
ruby -vruby 3.1.3p185 (2022-11-24 revision 1a6b16756e) [arm64-darwin22]
brew install libyamllibyaml 0.2.5 is already installed and up-to-date
PS: MacOS Ventura 13.1 M1 Pro
colby-swandale commentedon Jan 4, 2023
This works for me
gem install paych -- --with-libyaml-dir=$(brew --prefix libyaml)?But I'm running into this problem when I try to install ruby 3.2 also and breaks the entire installation 😕
nickarora commentedon Jan 6, 2023
To fix this; I reinstalled/rebuilt ruby with the following configuration:
This worked for Ruby 3.1.2 and libyaml 0.2.5 (installed via homebrew)