3

I was trying to push my local database to Heroku and received this error:

...Taps Server Error: PGError: ERROR: time zone displacement out of range:...

Some googling later I discovered that this error doesn't occur with ruby 1.9.2 and that (because being on windows) I'd have to install pik to run 1.9.2 alongside 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 plenty of googling I've ran into the following:

  • Don't bother using windows for ruby/rails development :(
  • Something to do with devkit?
  • Or installing a binary kit version of rails?
  • Compile it yourself

Any help is much 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
Liam McCabe
  • 53
  • 2
  • 8
  • The `ERROR: Failed to build gem native extension` error message is specific to a gem; one of the many gems bundled within `rails` is failing to install. The fix would most likely be different for each `gem`. Best to identify which gem is causing the error. It would help if you paste the full error stack trace. – Prakash Murthy Feb 02 '13 at 07:14
  • 1
    Hi Prakesh, I updated the post with the full error. Is it failing to install the json gem? Do I need to install the devkit for ruby 1.9.2 as stated here http://stackoverflow.com/questions/8884267/ruby-on-rails-how-do-i-install-json-on-windows-7. If so, how do I go about doing this? Thanks for your help :) – Liam McCabe Feb 02 '13 at 09:53

1 Answers1

2

The relevant part of the error message is gcc: Command not found; so the compiler is not available to compile the code locally.

If you already have gcc installed on your machine somewhere, make sure it is included in the PATH.

Check the How to install gcc on windows 7 machine? for guidance on how to install gcc on windows.

Community
  • 1
  • 1
Prakash Murthy
  • 12,923
  • 3
  • 46
  • 74
  • 2
    Thanks for your help Prakesh :) For anyone who sees this post. I used the following guide to install gcc: [Getting Started | MinGW](http://www.mingw.org/wiki/Getting_Started) – Liam McCabe Feb 02 '13 at 17:41