2

I am trying to update psych to 5.0.0, but I get the following error message:

Updating psych
Temporarily enhancing PATH for MSYS/MINGW...
Building native extensions. This could take a while...
ERROR:  Error installing psych:
        ERROR: Failed to build gem native extension.

    current directory: C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/psych-5.0.0/ext/psych
C:/Ruby31-x64/bin/ruby.exe -I C:/Ruby31-x64/lib/ruby/site_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:
.
.
.

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

  C:/Ruby31-x64/lib/ruby/gems/3.1.0/extensions/x64-mingw-ucrt/3.1.0/psych-5.0.0/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/psych-5.0.0 for inspection.
Results logged to C:/Ruby31-x64/lib/ruby/gems/3.1.0/extensions/x64-mingw-ucrt/3.1.0/psych-5.0.0/gem_make.out

Tried gem update, gem pristine --all, same error.

Any tips how to fix this in Windows?

Thank you!

Ioannis
  • 31
  • 5

3 Answers3

1

Not sure how it was fixed but I ran gem update and psych was updated to 5.0.2 without an error.

Ioannis
  • 31
  • 5
0

I had a similar problem on Mac running OSX 13.2. Bundle install failed because it couldn't find yaml.h.

Since I was on Mac and running Homebrew, I did a

brew install libyaml

and then re-ran bundle install. It worked correctly.

Steven Chanin
  • 570
  • 5
  • 5
-1

You need to install libyaml via pacman -S mingw-w64-ucrt-x86_64-libyamlin the command prompt with ruby

BartK
  • 1
  • 1
  • He is asking for a solution on Windows, not on ArchLinux. Also, this package doesn’t exist. – André Kugland Jan 07 '23 at 06:41
  • @AndréKugland Any idea how to do that in Windows? Thank you – Ioannis Jan 09 '23 at 08:55
  • @Ioannis, I’m sorry, I didn’t know that MSYS2 used a port of ArchLinux’s pacman. BartK’s answer might be correct. – André Kugland Jan 10 '23 at 18:02
  • Unfortunately, it it not: `pacman: The term 'pacman' is not recognized as a name of a cmdlet, function, script file, or executable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.` – Ioannis Jan 12 '23 at 11:25