Hello,
I have been using Rails 7.4.0.3 since its release in March without any issues on a Windows 11 system, having had setup about half a dozen projects since then.
However, an error is now preventing me from creating a new project with the basic “rails new [project]” command. I am getting this lovely feedback instead:
Installing psych 5.1.1.1 with native extensions warning: Public keyring not found; have you run ‘pacman-key --init’? error: mingw32: key “" is unknown error: keyring is not writable error: mingw64: key "” is unknown error: keyring is not writable error: ucrt64: key “" is unknown error: keyring is not writable error: clang32: key "” is unknown error: keyring is not writable error: clang64: key “" is unknown error: keyring is not writable error: msys: key "” is unknown error: keyring is not writable error: database ‘mingw32’ is not valid (invalid or corrupted database (PGP signature)) error: database ‘mingw64’ is not valid (invalid or corrupted database (PGP signature)) error: database ‘ucrt64’ is not valid (invalid or corrupted database (PGP signature)) error: database ‘clang32’ is not valid (invalid or corrupted database (PGP signature)) error: database ‘clang64’ is not valid (invalid or corrupted database (PGP signature)) error: database ‘msys’ is not valid (invalid or corrupted database (PGP signature)) Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: E:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/psych-5.1.1.1/ext/psych E:/Ruby31-x64/bin/ruby.exe -I E:/Ruby31-x64/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=E:/Ruby31-x64/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:
E:/Ruby31-x64/lib/ruby/gems/3.1.0/extensions/x64-mingw-ucrt/3.1.0/psych-5.1.1.1/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in E:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/psych-5.1.1.1 for inspection. Results logged to E:/Ruby31-x64/lib/ruby/gems/3.1.0/extensions/x64-mingw-ucrt/3.1.0/psych-5.1.1.1/gem_make.out
E:/Ruby31-x64/lib/ruby/3.1.0/rubygems/ext/builder.rb:102:in
run' E:/Ruby31-x64/lib/ruby/3.1.0/rubygems/ext/ext_conf_builder.rb:28:in
build’ E:/Ruby31-x64/lib/ruby/3.1.0/rubygems/ext/builder.rb:171:inbuild_extension' E:/Ruby31-x64/lib/ruby/3.1.0/rubygems/ext/builder.rb:205:in
block in build_extensions’ E:/Ruby31-x64/lib/ruby/3.1.0/rubygems/ext/builder.rb:202:ineach' E:/Ruby31-x64/lib/ruby/3.1.0/rubygems/ext/builder.rb:202:in
build_extensions’ E:/Ruby31-x64/lib/ruby/3.1.0/rubygems/installer.rb:843:inbuild_extensions' E:/Ruby31-x64/lib/ruby/3.1.0/bundler/rubygems_gem_installer.rb:72:in
build_extensions’ E:/Ruby31-x64/lib/ruby/3.1.0/bundler/rubygems_gem_installer.rb:28:ininstall' E:/Ruby31-x64/lib/ruby/3.1.0/bundler/source/rubygems.rb:207:in
install’ E:/Ruby31-x64/lib/ruby/3.1.0/bundler/installer/gem_installer.rb:54:ininstall' E:/Ruby31-x64/lib/ruby/3.1.0/bundler/installer/gem_installer.rb:16:in
install_from_spec’ E:/Ruby31-x64/lib/ruby/3.1.0/bundler/installer/parallel_installer.rb:186:indo_install' E:/Ruby31-x64/lib/ruby/3.1.0/bundler/installer/parallel_installer.rb:177:in
block in worker_pool’ E:/Ruby31-x64/lib/ruby/3.1.0/bundler/worker.rb:62:inapply_func' E:/Ruby31-x64/lib/ruby/3.1.0/bundler/worker.rb:57:in
block in process_queue’ E:/Ruby31-x64/lib/ruby/3.1.0/bundler/worker.rb:54:inloop' E:/Ruby31-x64/lib/ruby/3.1.0/bundler/worker.rb:54:in
process_queue’ E:/Ruby31-x64/lib/ruby/3.1.0/bundler/worker.rb:91:in `block (2 levels) in create_threads’An error occurred while installing psych (5.1.1.1), and Bundler cannot continue.
In Gemfile: debug was resolved to 1.8.0, which depends on irb was resolved to 1.8.3, which depends on rdoc was resolved to 6.5.0, which depends on psych run bundle lock --add-platform=x86_64-linux Writing lockfile to E:/Projets/stuff/Gemfile.lock run bundle binstubs bundler Could not find turbo-rails-1.5.0, stimulus-rails-1.3.0, web-console-4.2.1, irb-1.8.3, rdoc-6.5.0, psych-5.1.1.1 in locally installed gems rails importmap:install Could not find turbo-rails-1.5.0, stimulus-rails-1.3.0, web-console-4.2.1, irb-1.8.3, rdoc-6.5.0, psych-5.1.1.1 in locally installed gems Run
bundle install
to install missing gems. rails turbo:install stimulus:install Could not find turbo-rails-1.5.0, stimulus-rails-1.3.0, web-console-4.2.1, irb-1.8.3, rdoc-6.5.0, psych-5.1.1.1 in locally installed gems Runbundle install
to install missing gems.
I’m at a loss. Why is this happening? Why now? I can tell that yaml.h is missing from the log file referred to in the error message:
conftest.c:5:10: fatal error: yaml.h: No such file or directory 5 | #include <yaml.h> | ^~~~~~~~ compilation terminated. checked program was: /* begin / 1: #include “ruby.h” 2: 3: #include <winsock2.h> 4: #include <windows.h> 5: #include <yaml.h> / end */
I configured a custom Rake task for the first time yesterday and it worked fine - this is the only part of my work that stood out as unusual, so you can tell I’ve been sticking to really basic stuff. I could understand how dependencies can go out of date but I’m puzzled as to why this one seemed to have disappeared entirely. I created a new project last week without a hitch. Googling about yaml.h gives me a bunch of 10 year old tickets for Python related issues and installation tips for Ubuntu, which are completely useless to me. At this point I figure I might as well try installing a more recent version of Rails but that without understanding why the problem showed up in the first place, I don’t really see the point. So what’s wrong?
EDIT: Looks like I am actually getting the mistake when installing a Rails 7.1.1 project.