15

I'm trying to install ruby on a Windows box and am having an issue. I have gotten up to this point when I start getting errors, and I'm completely new to anything other than PHP for web development. Help appreciated!

EDIT I'm following the instructions here for wamp:

http://www.alexbernard.fr/fichiers/blog/Installer-Ruby-On-Rails-sur-un-Wamp-Server.pdf

./gem install rails --include-dependencies

Output:

INFO:  `gem install -y` is now default and will be removed
INFO:  use --ignore-dependencies to install only the gems you list
Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
ERROR:  Error installing rails:
        ERROR: Failed to build gem native extension.
        C:/wamp/ruby/bin/ruby.exe extconf.rb
creating Makefile
make
generating generator-x64-mingw32.def
compiling generator.c
make: x86_64-w64-mingw32-gcc: Command not found
make: *** [generator.o] Error 127
Gem files will remain installed in C:/wamp/ruby/lib/ruby/gems/2.0.0/gems/json-1.8.0 for inspection.
Results logged to C:/wamp/ruby/lib/ruby/gems/2.0.0/gems/json-1.8.0/ext/json/ext/generator/gem_make.out
carbide20
  • 1,717
  • 6
  • 29
  • 52
  • Using rails with wamp is a mistake. If you're doing development you should be using built-in webrick or similar. If you're doing production you should be using linux. – pguardiario May 16 '13 at 09:50

5 Answers5

30

From the output shown above, I assume the following:

  • Installed Ruby 2.0.0 x64 (64bits)
  • Installed some DevKit from RubyInstaller page

Now, as explained here, for 64bits Ruby you need 64bits DevKit.

From the error in the output:

make: x86_64-w64-mingw32-gcc: Command not found

It is clear you didn't install the right DevKit.

Please remove the DevKit installed, download the correct one (as indicated in the link above and in RubyInstaller downloads page) and install again.

You will require to use ruby dk.rb install --force (note the --force option) to override the previous DevKit installation.

As for the the deprecation error, --include-dependencies is no longer required. I recommend you use as installation reference a modern Ruby/Rails guide.

Community
  • 1
  • 1
Luis Lavena
  • 10,348
  • 1
  • 37
  • 39
  • Is it possible to have two DevKit installations (32bit and 64bit) side by site? I have both 32bit and 64bit Ruby installed which I switch between for testing. But I can only get one to install compiled gems at a time - the one where I installed matching DevKit for last. – thomthom Oct 06 '14 at 13:55
  • 2
    @thomthom eg. Install 32bits Ruby to `C:\Ruby200` and 64bits to `C:\Ruby200-x64`, then place DevKit in similar way: `C:\DevKit\4.7.2-32` and `C:\DevKit\4.7.2-64`, edit `config.yml` of each one to point to right Ruby installation. – Luis Lavena Oct 06 '14 at 20:01
  • That's what I did. Hm... I'll try again fresh and file an issue at GitHub if problem persist. – thomthom Oct 07 '14 at 10:17
  • 1
    @LuisLavena - Thanks for the post. But, this did not work for me. I have ruby 2.0.0 x64 from Ruby installer. Devkkit - DevKit-mingw64-64-4.7.2-20130224-1432-sfx.exe. I even installed mingw with the base and developer packages. I am stuck where I started. I have no choice but to do this on a Windows machine. – Erran Morad Jan 13 '15 at 00:33
  • Thanks a lot, I spent two days trying to figure this one out. – Keith Loughnane Jan 06 '16 at 14:57
5

You can go the RailsInstaller way to install Rails and all dependencies in one go without getting into such problems.

Jahan Zinedine
  • 14,616
  • 5
  • 46
  • 70
5

For me, the problem was that the DevKit binaries did not get added to the PATH. Make sure that (DEVKIT_FOLDER)\mingw\bin is on the path.

Aaron Kelley
  • 51
  • 1
  • 1
0

Because I read this answer with hope of fixing my problem, and found it did not help, here's how I resolved it:

--

Your error is:

make: x86_64-w64-mingw32-gcc: Command not found

--

The error means that you don't have access to the gcc/gc++ compiler on your PC.

You should therefore either locate, or download a version of the compiler to your system. I found installing the build tools located here solved the issue.

You just have to download those tools, then add them to the PATH var: set PATH=C:/path/to/your/ming64/location/;%PATH%;

This should build it for you.

A caveat -- whether you have the correct dependencies for a build to take place is another question entirely.

Richard Peck
  • 76,116
  • 9
  • 93
  • 147
0

The exe is in rubydevkit\mingw\bin. Just add that to your path and json will build.