无法在窗户上安装导轨

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

嘿,我正在尝试为我正在进行的项目安装导轨

gem install rails

但我收到此错误

error: failed to init transaction (unable to lock database)
error: could not lock database: Permission denied
ERROR:  Error installing rails:
        ERROR: Failed to build gem native extension.

    current directory: C:/Users/smith/.local/share/gem/ruby/3.2.0/gems/psych-5.1.1.1/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/smith/.local/share/gem/ruby/3.2.0/extensions/x64-mingw-ucrt/3.2.0/psych-5.1.1.1/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in C:/Users/smith/.local/share/gem/ruby/3.2.0/gems/psych-5.1.1.1 for inspection.
Results logged to C:/Users/smith/.local/share/gem/ruby/3.2.0/extensions/x64-mingw-ucrt/3.2.0/psych-5.1.1.1/gem_make.out
Using rubygems directory: C:/Users/smith/.local/share/gem/ruby/3.2.0
Temporarily enhancing PATH for MSYS/MINGW...
Installing required msys2 packages: mingw-w64-ucrt-x86_64-libyaml
pacman failed with the following output:
Building native extensions. This could take a while...

我正在尝试让 Rails 工作,但由于某种原因,它没有任何步骤来解决这个问题,我尝试其他堆栈溢出方法,但它仍然无法像代理一样工作并为 ruby 创建 devkit

ruby-on-rails rubygems
1个回答
0
投票

对我来说,我只是使用更新了 gem

gem update --system
,以管理员身份执行命令提示符,然后使用
gem install rails
安装 Rails 。快乐编码! 🚀😊

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