Gem::InstallError: The 'nio4r' native gem requires installed build tools

7.3k Views Asked by At

I am trying to run bundle install and I get the following error message (screenshots attached):

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.

When the installation fails

So then, I run gem install nio4r -v '1.2.1' and it installs perfectly as the screenshot below.When the installation succeeds

The paths I have set is as follows: The paths screenshots

5

There are 5 best solutions below

3
On BEST ANSWER

Somehow or another you're interacting with two different installations of Ruby and the on later in the PATH has Bundler installed.

Once you install the Devkit the must install Devkit message is completely removed from the installation.

Try running where.exe bundle to see where the Bundler executables are at, then run where.exe gem to see where your RubyGem executables are and compare.

If you have two different gem executable locations then you probably could just use gem install bundler to quickly fix the problem.

0
On

download newer version of ruby (download from official site) and then try to install rail, your problem will be solve.

0
On

I removed the 64-bit and installed the 32-bit Ruby, and it worked fine. Although I had the 64-bit DevKit, it worked without me having to install the 32-bit Devkit.

3
On

Try this out:

Manually downloading the latest .gem file from rubygems.org. Install it using gem install nio4r-x.x.x.gem

0
On

I have had the same issue. I download DEVELOPMENT KIT from rubby website, and followed the instruction at here. After installing DevKit, the issue was resolved. My OS was Win64X and I installed Ruby-2.3.3-64X accordingly.