'puma' 本机 gem 需要安装构建工具

The 'puma' native gem requires installed build tools

我在 运行 bundle install

时遇到这个错误
Gem::InstallError: The 'puma' native gem requires installed build tools.

Please update your PATH to include build tools or download the DevKit
from 'http://rubyinstaller.org/downloads' and follow the instructions
at 'http://github.com/oneclick/rubyinstaller/wiki/Development-Kit'

我正在使用已经有 DevKit 的 RailsInstaller。

我以前没有遇到过这个问题,但是我将 ruby 版本从 2.2.4 更改为 2.2.5 后似乎出现了。我正在使用 windows 计算机。知道如何解决这个问题吗?

我按照以下说明解决了问题:

  • 从这里下载开发包。

  • 在 DevKit 文件夹中安装文件

  • 打开 cmd 并导航到文件夹

  • 复制你在C盘安装的ruby文件夹路径,粘贴到DevKit\config.yml中。将路径中的‘/’改为‘\’。

它应该是这样的:

# Example:
#
# ---
# - C:/ruby19trunk
# - C:/ruby192dev
#
---
- C:\Ruby22
  • 运行 ruby dk.rb install
  • 回到你的 rails 文件夹,运行 bundle install 你应该不会有任何错误