1

I've scoured the internet looking for an answer to this issue I've been having for the past 4 hours but I've hit a dead end...

I installed RoR through the installer at rubygems.org. I ran through many tutorials and decided to start on a project that uses 'gem install blog'. I've got most of it installed but the second I try to 'install bundle' I get this error:

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

c:/Ruby21/bin/ruby.exe extconf.rb creating Makefile

make "DESTDIR=" clean 0 [main] rm 8308 open_stackdumpfile: Dumping stack trace to rm.ex mp make: [clean-static] Error 5 (ignored) 0 [main] rm 8316 open_stackdumpfile: Dumping stack trace to rm.ex mp make: [clean] Error 5 (ignored)

make "DESTDIR=" generating generator-i386-mingw32.def compiling generator.c make: gcc: Command not found make: *** [generator.o] Error 127

make failed, exit code 2

Gem files will remain installed in c:/Ruby21/lib/ruby/gems/2.1.0/gems/j for inspection. Results logged to c:/Ruby21/lib/ruby/gems/2.1.0/extensions/x86-mingw32/ n-1.8.2/gem_make.out An error occurred while installing json (1.8.2), and Bundler cannot con Make sure that gem install json -v '1.8.2' succeeds before bundling.

Now, I've attempted to install JSON by itself, and I've already installed the Devkit and run it into my project but I'm at a loss. Here is what happens when I try to install JSON.

Temporarily enhancing PATH to include Devkit... Building native extensions. This could take a while... ERROR: Error installing json: ERROR: Failed to build gem native extension.

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

c:/Ruby21/bin/ruby.exe extconf.rb creating Makefile

make "DESTDIR=" clean 0 [main] rm 8308 open_stackdumpfile: Dumping stack trace to rm.ex mp make: [clean-static] Error 5 (ignored) 0 [main] rm 8316 open_stackdumpfile: Dumping stack trace to rm.ex mp make: [clean] Error 5 (ignored)

make "DESTDIR=" generating generator-i386-mingw32.def compiling generator.c make: gcc: Command not found make: *** [generator.o] Error 127

make failed, exit code 2

Gem files will remain installed in c:/Ruby21/lib/ruby/gems/2.1.0/gems/j for inspection. Results logged to c:/Ruby21/lib/ruby/gems/2.1.0/extensions/x86-mingw32/ n-1.8.2/gem_make.out An error occurred while installing json (1.8.2), and Bundler cannot con Make sure that gem install json -v '1.8.2' succeeds before bundling.

I've pretty much tried everything I can think of (which isn't a lot as I'm very new to the whole Ruby language).

Any help that could be given would be great! I'm not looking for a handout, I really do want to understand exactly what's going on.

ChretienM
  • 11
  • 3
  • Did you ran "devkitvars.bat" from DevKit directory? And did you tried to run console with Administrator priviliges? What version of Windows do you have? – Sebastian Piskorski Jan 22 '15 at 13:36

2 Answers2

2

I solved this problem by re-installing Ruby.

I suspect upgrading to OS X Yosemite had a hand in causing the problem as I just upgraded yesterday.

The error:

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

/Users/cartersowers/.rbenv/versions/2.1.5/bin/ruby extconf.rb 
creating Makefile

make "DESTDIR=" clean

make "DESTDIR="
compiling generator.c
linking shared-object json/ext/generator.bundle
ld: library not found for -lgmp
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [generator.bundle] Error 1

make failed, exit code 2

Gem files will remain installed in /Users/cartersowers/projects/soomo/vendor/bundle/ruby/2.1.0/gems/json-1.8.2 for inspection.
Results logged to /Users/cartersowers/projects/soomo/vendor/bundle/ruby/2.1.0/extensions/x86_64-darwin-13/2.1.0-static/json-1.8.2/gem_make.out
An error occurred while installing json (1.8.2), and Bundler cannot continue.
Make sure that `gem install json -v '1.8.2'` succeeds before bundling.

Then I reinstalled

rbenv install 2.1.5

And all was well.

carterS
  • 21
  • 3
  • appears that others have had to reinstall ruby after upgrading to OS X Yosemite http://danielpuglisi.com/articles/2014/10/reinstall-ruby-after-upgrading-to-osx-yosemite – carterS Mar 10 '15 at 21:46
  • Thanks for this, not sure i'd have every guessed the solution otherwise. – Tony Beninate May 22 '17 at 18:14
0

Try to leverage console priviliges and run it as admin ( cmd.exe ). Then use ruby command gem install blog .

As you run install second time, Ruby will ask you if you want files overwritten. If you haven't change anything you can choose a - overwrtie all

Sebastian Piskorski
  • 4,026
  • 3
  • 23
  • 29