2
votes

Please help me, I am desperate.

I am encountering the following error when installing different gems:

Building native extensions.  This could take a while...
ERROR:  Error installing bson_ext:
    ERROR: Failed to build gem native extension.
...        

For this reason I want to install the Ruby DevKit. I am using the proper version (Ruby 1.9.3-p429 with DevKit-tdm-32-4.5.2-20111229-1559-sfx.exe).

I followed the proper steps:

  • ruby dk.rb init
  • ruby dk.rb review => yes, C:\Ruby193 is appearing in config.yml
  • ruby dk.rb install => here comes my problem. When I execute the command (in an elevated cmd), I only get these two messages:

[INFO] Updating convenience notice gem override for 'C:/Ruby193' [INFO] Installing 'C:/Ruby193/lib/ruby/site_ruby/devkit.rb'

After that I try to verify that the DevKit is installed correctly, so I run: gem install json --platform=ruby

and I still get the same error as at the beginning (ERROR: Failed to build gem native extension.)

Please, help!

P.S. Some additional info: when I go to C:\Ruby193\bin gcc.bat, make.bat, and sh.bat are not present, which is probably at the root of my problem...

2
did u changed your system path to add devkit? - Krishna Rani Sahoo
Krishna, this solved my problem. Thank you very much. God bless you. Please, add this as an answer, so I can mark it as best answer. :) - Alexander Popov
Hi I got same problem, can you elaborate more about adding system path? My Devkit is in C:\DevKit and I have added it in my Path variables in my System Variables. But still got the error. Thanks - hrsetyono
Did you restart your computer after adding C:\DevKit to the Path variable? Also, did you make sure you separated it from the rest with a ; before it? If all this is true, probably your problem will not be solved through installing the DevKit and you have to post a new question with more details. - Alexander Popov
Nevermind, I used the wrong Devkit. For Ruby 1.9.3 and below, I should use the tdm not the mingw - hrsetyono

2 Answers

4
votes

change your system path to add devkit

0
votes

It is important to note the version of the Ruby installation. I used Ruby 32 bit installation on a 64 bit machine and i tried to download the 64 bit Devkit. Even when I added the path this was useless because by ruby installation was 32 bit. So I downloaded the 32 bit Devkit and it successfully installed. Thanks for these wonderful answers and questions. They all helped.