ROR初心者です。地域の開発と研究を立ち上げようとしています。 私はすでに Ruby 開発キットを持っており、rubyinstaller.org からインストールします (Ruby+Devkit 3.2.3-1 (x64)) これが私の Ruby のバージョンです -> Ruby 3.2.3 (2024-01-18 リビジョン 52bb2ac0a6) [x64-mingw-ucrt]
ここで、CLI で「gem install Rails」を実行またはインストールすると、次のエラーが発生しました。
Using rubygems directory: C:/Users/My name here/.local/share/gem/ruby/3.2.0
Temporarily enhancing PATH for MSYS/MINGW...
Installing required msys2 packages: mingw-w64-ucrt-x86_64-libyaml
error: failed to init transaction (unable to lock database)
error: could not lock database: Permission denied
pacman failed with the following output:
Building native extensions. This could take a while...
ERROR: Error installing rails:
ERROR: Failed to build gem native extension.
current directory: C:/Users/My name here/.local/share/gem/ruby/3.2.0/gems/psych-5.1.2/ext/psych
C:/Ruby32-x64/bin/ruby.exe 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=C:/Ruby32-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:
C:/Users/My name here/.local/share/gem/ruby/3.2.0/extensions/x64-mingw-ucrt/3.2.0/psych-5.1.2/mkmf.log
ここで mkmf.log を確認すると、結果は次のとおりです。
PATH=".;C:/Ruby32-x64/lib;C:\Ruby32-x64\bin;C:\Ruby32-x64\msys64\ucrt64\bin;C:\Ruby32-x64\msys64\usr\bin;C:\Ruby32-x64\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files\Amazon\AWSCLIV2\;C:\Kube;C:\Program Files\MongoDB\Server\5.0\bin;C:\Program Files\Git\cmd;C:\Program Files\PuTTY\;C:\sqlite;C:\Program Files\Java\jdk-19\bin;C:\Program Files\Common Files\Oracle\Java\javapath;C:\Program Files\Docker\Docker\resources\bin;C:\Program Files\Kubernetes\Minikube;C:\Program Files\Apache Maven\apache-maven-3.9.4\bin;C:\Program Files\nodejs\;C:\Users\My name here surname\AppData\Local\Programs\Python\Python311\Scripts\;C:\Users\My name here surname\AppData\Local\Programs\Python\Python311\;C:\Users\My name here surname\AppData\Local\Programs\Python\Python39\Scripts\;C:\Users\My name here surname\AppData\Local\Programs\Python\Python39\;C:\Users\My name here surname\AppData\Local\Microsoft\WindowsApps;C:\Users\My name here surname\AppData\Local\Programs\Microsoft VS Code\bin;C:\terraform;C:\Program Files (x86)\GnuWin32\bin;;C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2022.3.2\bin;C:\Program Files\qpdf 11.5.0\bin;;C:\Users\My name here\AppData\Roaming\npm" "gcc -IC:/Ruby32-x64/include/ruby-3.2.0/x64-mingw-ucrt -IC:/Ruby32-x64/include/ruby-3.2.0/ruby/backward -IC:/Ruby32-x64/include/ruby-3.2.0 -I. -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0600 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64 -DYAML_DECLARE_STATIC -O3 -fno-fast-math -fstack-protector-strong -m64 -c conftest.c"
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 */
ここで助けを求めています、私は現在道に迷っています
すでに解決済みです。 CMDを管理者として実行する 次に cli に入力します ->
それはうまくいくはずです