Gem::InstallError:'nio4r' 原生 gem 需要安装构建工具

Sut*_*ala 5 ruby windows-10 ruby-development-kit

我正在尝试运行bundle install,但收到以下错误消息(附上截图):

Gem::InstallError: The 'nio4r' 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'

An error occurred while installing nio4r (1.2.1), and Bundler cannot continue.
Make sure that `gem install nio4r -v '1.2.1'` succeeds before bundling.
Run Code Online (Sandbox Code Playgroud)

安装失败时

然后,我运行gem install nio4r -v '1.2.1'并完美安装,如下面的屏幕截图所示。安装成功时

我设置的路径如下: 路径截图

Azo*_*olo 2

不知何故,您正在与两个不同的 Ruby 安装进行交互,并且稍后PATH安装了 Bundler。

安装 Devkit 后,该must install Devkit消息将从安装中完全删除。

尝试运行where.exe bundle以查看 Bundler 可执行文件所在的位置,然后运行where.exe gem以查看 RubyGem 可执行文件所在的位置并进行比较。

如果您有两个不同的gem可执行位置,那么您可能可以使用它gem install bundler来快速解决问题。