使用捆绑安装时不会安装Psych

问题描述 投票:0回答:1

我正在尝试更新 Rails 应用程序中的一些 gem,当一个名为 psych 5.0.2 的 gem 时,我收到以下错误。 我在一些网站上看到过有关此问题的类似报告,但没有任何帮助我。任何帮助将不胜感激。

版本:Windows 10,Ruby:3.05,Rails:7.0.0(刚刚从 5.2.2 更改),Bundler:2.2.33

Using stringio 3.0.4
Fetching psych 5.0.2
Installing psych 5.0.2 with native extensions
error: failed retrieving file 'mingw-w64-x86_64-libyaml-0.2.2-1-any.pkg.tar.xz' from repo.msys2.org : The requested URL returned error: 404
error: failed retrieving file 'mingw-w64-x86_64-libyaml-0.2.2-1-any.pkg.tar.xz' from sourceforge.net : The requested URL returned error: 404
error: failed retrieving file 'mingw-w64-x86_64-libyaml-0.2.2-1-any.pkg.tar.xz' from www2.futureware.at : The requested URL returned error: 404
error: failed retrieving file 'mingw-w64-x86_64-libyaml-0.2.2-1-any.pkg.tar.xz' from mirror.yandex.ru : The requested URL returned error: 404
warning: failed to retrieve some files
error: failed to commit transaction (unexpected error)
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory:
C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/psych-5.0.2/ext/psych
C:/Ruby30-x64/bin/ruby.exe -I C:/Ruby30-x64/lib/ruby/3.0.0 -r
./siteconf20230120-15584-xuwv0b.rb 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.
ruby-on-rails ruby installation bundle psych
1个回答
0
投票

“嘿,Windows 开发人员朋友们!

要让您的服务器顺利启动并运行,请按照以下简单步骤操作:

  1. 首先,通过运行安装“psych”gem:
gem install psych
  1. 接下来,执行:
bundle install
  1. 最后,使用以下命令启动 Rails 服务器:
rails s

就是这样!您的服务器很快就会愉快地运行。快乐编码!”

© www.soinside.com 2019 - 2024. All rights reserved.