Al Hoang

December 19, 2006

Getting a ruby C extension to compile on Windows Part 2

Filed under: gripe, programming, ruby — hoanga @ 3:23 am

In a previous post I mentioned how to get the Ruby C extension to compile under Windows using Visual Studio Express/Studio 2005. However, I left out an important part regarding manifests which have been part of the development process in VC++7 and above.

Manifests are some XML representation of the bindings and and activation (whatever that means) for many things such as classes, libraries, and assemblies. It boils down to you need one if you’re going to deploy a library (DLL) or executable (EXE) made with VC++ 2005. The manifests by default will go into a file called .manifest however for our purposes we will need to embed it into the library (in this case it is a .so not a .dll).

Here’s the howto:

C:\exttest>mt.exe -manifest my_test.so.manifest -outputresource:my_test.so;2
C:\exttest>nmake install
C:\exttest>irb
irb(main):002:0> require 'my_test'
=> true
irb(main):003:0>

The main thing you need to remember is (don’t forget the 2!!)
mt.exe -manifest my_lib_name.so.manifest -outputresource:my_lib_name.so;2

Resources

Wirble: A ruby gem that gives tab-completion + syntax coloring to irb

Filed under: programming, ruby — hoanga @ 2:14 am

Ruby Inside has a
blog post
on an add-on to irb that allows tab-completion and syntax coloring for irb. Way cool!
The install instructions are simple as:

  1. Install Ruby Gems (You DO have this installed, right?)
  2. sudo gem install -y wirble
  3. Then add the following to $HOME/.irbrc

    require ‘rubygems’
    require ‘wirble’
    Wirble.init
    Wirble.colorize

Then enjoy working with ruby in full (ascii) technicolor.

Powered by WordPress

Protected by AkismetBlog with WordPress