Get: "ERROR: Failed to create native gem extension" when trying to install rails gem on ruby 1.9.2 using pik
I was trying to push my local database to Heroku and got this error:
...Taps Server Error: PGError: ERROR: time zone displacement out of range:...
Some time later I found that this error does not occur with ruby 1.9.2
, and that (because on windows) I would have to install pik
1.9.2 to run next to 1.9.3. So I installed pik and ruby 1.9.2.
However, when I try to install rails
on 1.9.2
, I get this error:
...ERROR: Failed to build gem native extension...
After many searches, I came across the following:
- It is not recommended to use windows for ruby / rails development :(
- Something to do with devkit?
- Or install a binary set of rail versions?
- Compile it yourself
Any help is greatly appreciated!
EDIT:
Full error stack trace:
Building native extensions. This could take a while...
ERROR: Error installing rails:
ERROR: Failed to build gem native extension.
C:/Ruby192/bin/ruby.exe extconf.rb
creating Makefile
make
gcc -I. -IC:/Ruby192/include/ruby-1.9.1/i386-mingw32 -I/C/Ruby192/include/ruby-1.9.1/ruby/backward -
I/C/Ruby192/include/ruby-1.9.1 -I. -DJSON_GENERATOR -O3 -g -Wextra -Wno-unused-parameter -Wno-par
entheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-initializers -Wno-long-long -O3 -Wall -O
0 -ggdb -o generator.o -c generator.c
make: gcc: Command not found
make: *** [generator.o] Error 127
Gem files will remain installed in C:/Ruby192/lib/ruby/gems/1.9.1/gems/json-1.7.6 for inspection.
Results logged to C:/Ruby192/lib/ruby/gems/1.9.1/gems/json-1.7.6/ext/json/ext/generator/gem_make.out
source to share
The relevant part of the error message gcc: Command not found
; therefore the compiler is not available to compile the code locally.
If you already have gcc
one installed on your computer, make sure it is turned on PATH
.
Check out How to install gcc on a Windows 7 machine? to see how to install gcc on windows.
source to share