首页 > 解决方案 > Ruby on rails:捆绑更新在 Windows 中出现错误

问题描述

我正在尝试运行我的 Rails 服务器。当我第一次运行时,我遇到了这样的错误

找不到时区数据源。要解决此问题,请安装 TZInfo:

我通过更新 gem 文件中 tzinfo-data 的 x64 版本来解决该错误。之后,当我运行bundle update时,出现以下错误

* extconf.rb 失败 *由于某种原因无法创建 Makefile,可能缺少必要的库和/或头文件。检查 mkmf.log 文件以获取更多详细信息。您可能需要配置选项。

提供的配置选项: --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:/Ruby24-x64/bin/$(RUBY_BASE_NAME) --with-libxml2-config --without-libxml2-config --with-pkg-config --without-pkg-config extconf. rb:29:in `': "libxml2" 包不可用。(运行时错误)

要查看此扩展无法编译的原因,请查看 mkmf.log,可在此处找到:

C:/Ruby24-x64/lib/ruby/gems/2.4.0/extensions/x64-mingw32/2.4.0/ovirt-engine-sdk-4.3.0/mkmf.log

extconf 失败,退出代码 1

Gem 文件将继续安装在 C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/ovirt-engine-sdk-4.3.0 以供检查。结果记录到 C:/Ruby24-x64/lib/ruby/gems/2.4.0/extensions/x64-mingw32/2.4.0/ovirt-engine-sdk-4.3.0/gem_make.out

安装 ovirt-engine-sdk (4.3.0) 时出错,Bundler 无法继续。gem install ovirt-engine-sdk -v '4.3.0' --source 'https://rubygems.org/'在捆绑之前确保成功。

在 Gemfile 中:fog 被解析为 2.1.0,它依赖于 fog-ovirt 被解析为 1.1.6,它依赖于 ovirt-engine-sdk

可能出了什么问题?如何在 Windows 机器上解决这个问题?

标签: ruby-on-railsrubywindowslibxml2ovirt

解决方案


我知道这对你来说可能不是一个好的答案,但是在 Windows 上运行 Ruby on Rails 是一件痛苦的事情,而且体验会很糟糕,尝试使用 Ubuntu、Debian 或任何其他 Linux 发行版以及 Windows 和那么您可以按照应该的方式使用 RoR 进行开发。


推荐阅读