2

我正在尝试在 Windows 上安装 rails 应用程序。当我调用此命令时:

bundle install

我收到此错误:

在此处输入图像描述

如何解决?

4

2 回答 2

5

您需要按照此处所述安装Ruby 开发工具包: https ://github.com/oneclick/rubyinstaller/wiki/Development-Kit

它将安装一个 mingw 环境,允许 ruby​​gems 为 Windows 平台编译二进制 gem。

请注意遵循本节中描述的安装后步骤:https ://github.com/oneclick/rubyinstaller/wiki/Development-Kit#4-run-installation-scripts

仅在硬盘上拥有 ruby​​-devkit 文件不足以让 ruby​​gems 使用它。

于 2013-10-04T07:59:51.970 回答
0

这些bundle install命令包含在 Ruby DevKit 中。

确保如果您已正确安装了 Ruby 开发工具包 ( https://rubyinstaller.org/add-ons/devkit/ ),它还可以找到 Ruby 在您的 HD 上的安装位置。

当您使用该命令时ruby dk.rb init,您应该收到这样的消息

[INFO] found RubyInstaller v2.3.3 at C:/Ruby23-x64

您还可以使用该ruby dk.rb review命令确保 DevKit 已找到您的 Ruby 安装路径。你应该收到这样的消息

Based upon the settings in the 'config.yml' file generated
from running 'ruby dk.rb init' and any of your customizations,
DevKit functionality will be injected into the following Rubies
when you run 'ruby dk.rb install'.

C:/Ruby23-x64

对配置文件中指定的目录感到满意后,运行ruby dk.rb install命令。如果你要重新安装 DevKit,你可以使用 -f 命令覆盖之前所做的任何事情。

您应该会看到类似这样的内容(如果您使用了 -f):

[WARN] Updating (with backup) existing gem override for 'C:/Ruby23-x64'
[WARN] Updating (with backup) DevKit helper library for 'C:/Ruby23-x64'

完成后,您可以通过运行命令检查 Devkit 是否已正确安装install json --platform=ruby,之后您应该会看到:

Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
Successfully installed json-2.1.0
Parsing documentation for json-2.1.0
Installing ri documentation for json-2.1.0
Done installing documentation for json after 2 seconds
1 gem installed 

一旦您的 json 安装开始,您就知道您的 DevKit 已成功安装,这应该可以防止“make”错误的发生。

于 2017-05-17T17:06:57.720 回答