无法在 Windows 上安装 Rails

not able to install rails on windows

提问人:Johnny Louifils 提问时间:11/17/2023 更新时间:11/17/2023 访问量:29

问:

嘿,我正在尝试为我正在从事的项目安装导轨

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 红宝石

评论


答: 暂无答案