narzero
narzero

Reputation: 2299

Can't install Mongo gem - make failed, exit code 1

I've installed Ruby 2.4.0 on Windows via the RubyInstaller. Ruby works fine and I've been able to install all the gems I've wanted so far.

But I'm having issues installing the mongo gem. When I do gem install mongo --no-rdoc --no-ri I get the following error:

current directory: C:/Ruby24/lib/ruby/gems/2.4.0/gems/bson-4.2.2/ext/bson
C:/Ruby24/bin/ruby.exe -r ./siteconf20170719-13960-1i1n5nq.rb extconf.rb
creating Makefile

current directory: C:/Ruby24/lib/ruby/gems/2.4.0/gems/bson-4.2.2/ext/bson
make "DESTDIR=" clean
'make' is not recognized as an internal or external command,
operable program or batch file.

current directory: C:/Ruby24/lib/ruby/gems/2.4.0/gems/bson-4.2.2/ext/bson
make "DESTDIR="
'make' is not recognized as an internal or external command,
operable program or batch file.

make failed, exit code 1

What am I doing wrong?

Upvotes: 0

Views: 630

Answers (2)

Lars Kanis
Lars Kanis

Reputation: 896

The bson gem is a dependency of mongo, which requires a working build environment to install. The officially supported build environment for RubyInstaller-2.4 and newer is MSYS2. It can be installed on the last page of the installer or later per ridk install command. It's best to use the default options there.

Upvotes: 1

Florian Weimer
Florian Weimer

Reputation: 33717

Installing this gem apparently needs a working C compiler and supporting programs (including make). You probably have to install mingw-w64 or Cygwin.

Upvotes: 0

Related Questions