follow me icons

Friday, October 15, 2010

Ruby Devkit for windows native extensions

I receive the above error when trying to install ruby-debug in Windows.
gem install ruby-debug


C:\>gem install ruby-debug
Building native extensions.  This could take a while...
ERROR:  Error installing ruby-debug:
ERROR: Failed to build gem native extension.

C:/Ruby187/bin/ruby.exe extconf.rb
creating Makefile

make
'make' is not recognized as an internal or external command,
operable program or batch file.


Gem files will remain installed in 
C:/Ruby187/lib/ruby/gems/1.8/gems/linecache-0.43 for inspection.
Results logged to C:/Ruby187/lib/ruby/gems/1.8/gems/linecache-0.43/ext/gem_make.out

To fix it:
1. Download Devkit in the ruby website. Download the one under the "Development Kit"
2. Extract the file
3. run "ruby dk.rb init"
4. run "ruby dk.rb install"

Result:
D:\DevKit>gem install ruby-debug
Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
Building native extensions.  This could take a while...
Successfully installed linecache-0.43
Successfully installed ruby-debug-base-0.10.3
Successfully installed ruby-debug-0.10.3
3 gems installed
Installing ri documentation for linecache-0.43...
Installing ri documentation for ruby-debug-base-0.10.3...
Installing ri documentation for ruby-debug-0.10.3...
Installing RDoc documentation for linecache-0.43...
Installing RDoc documentation for ruby-debug-base-0.10.3...
Installing RDoc documentation for ruby-debug-0.10.3...

For more information about dev-kit please visit the github page

2 comments:

  1. If you still get the native extension error please try the following:

    1. run "ruby dk.rb --force install"

    if it still does not work, view the config.yml file.

    at the end of the config.yml file it has the ruby location. If you have 2 versions of ruby in Windows, you have to make sure that it install the devkit in the correct location.

    in my case the config.yml was pointing to C:/Ruby187 and I need to change it to C:/RailsInstallaler/Ruby1.9.3

    ReplyDelete
  2. If you are using Ruby 1.9.3 simply install

    gem install debugger

    ruby-debug gem won't work for Ruby 1.9.3

    ReplyDelete