Skip to content

Failed to install Ruby 3.2.0 due to libyaml & psych related failure (M1 Chip Related) #328

@edwinthinks

Description

@edwinthinks

Greetings! Hope this isn't a repeat issue and this is actually new. Either way, I'm hoping to get some guidance.

I'm encountering the following issue when I run asdf install ruby 3.2.0:

To follow progress, use 'tail -f /var/folders/hw/xt0thdhd3ysghbkd16smwk140000gn/T/ruby-build.20230109121040.89183.log' or pass --verbose
Downloading openssl-3.0.7.tar.gz...
-> https://dqw8nmjcqpjn7.cloudfront.net/83049d042a260e696f62406ac5c08bf706fd84383f945cf21bd61e9ed95c396e
Installing openssl-3.0.7...
Installed openssl-3.0.7 to /Users/emak/.asdf/installs/ruby/3.2.0

Downloading ruby-3.2.0.tar.gz...
-> https://cache.ruby-lang.org/pub/ruby/3.2/ruby-3.2.0.tar.gz
Installing ruby-3.2.0...
ruby-build: using readline from homebrew
ruby-build: using gmp from homebrew

BUILD FAILED (macOS 12.6.1 using ruby-build 20221225)

Inspect or clean up the working tree at /var/folders/hw/xt0thdhd3ysghbkd16smwk140000gn/T/ruby-build.20230109121040.89183.0fqGWu
Results logged to /var/folders/hw/xt0thdhd3ysghbkd16smwk140000gn/T/ruby-build.20230109121040.89183.log

Last 10 log lines:
	Check ext/psych/mkmf.log for more details.
*** Fix the problems, then remove these directories and try again if you want.
Generating RDoc documentation
/private/var/folders/hw/xt0thdhd3ysghbkd16smwk140000gn/T/ruby-build.20230109121040.89183.0fqGWu/ruby-3.2.0/lib/yaml.rb:3: warning: It seems your ruby installation is missing psych (for YAML output).
To eliminate this warning, please install libyaml and reinstall your ruby.
uh-oh! RDoc had a problem:
cannot load such file -- psych

run with --debug for full backtrace
make: *** [rdoc] Error 1

What I've tried

I've tried installing libyaml which says it already installed when running brew install libyaml

I tried to install psych 5.0.1 using gem install psych which yields the following error saying that yaml.h not found:

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

    current directory: /Users/emak/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/psych-5.0.1/ext/psych
/Users/emak/.asdf/installs/ruby/3.1.3/bin/ruby -I /Users/emak/.asdf/installs/ruby/3.1.3/lib/ruby/3.1.0 extconf.rb
checking for yaml.h... no
yaml.h 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/emak/.asdf/installs/ruby/3.1.3/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

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  /Users/emak/.asdf/installs/ruby/3.1.3/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/emak/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/gems/psych-5.0.1 for inspection.
Results logged to /Users/emak/.asdf/installs/ruby/3.1.3/lib/ruby/gems/3.1.0/extensions/arm64-darwin-21/3.1.0/psych-5.0.1/gem_make.out

Operating System

MacOSX Montery 12.16.1 - M1 Max Chip

Appreciate it!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions