Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 241
Suthan Bala Avatar asked Oct 18 '22 18:10

Suthan Bala


2 Answers

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.

like image 55
Azolo Avatar answered Oct 21 '22 08:10

Azolo


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.

like image 23
Suthan Bala Avatar answered Oct 21 '22 06:10

Suthan Bala