Search code examples
rubyruby-1.9ruby-1.8

How to Call/Require Ruby 1.8 Lib from Ruby 1.9


I'm using a Ruby 1.8 lib kakasi-ruby, but it seems that it can only be compiled against Ruby 1.8 (https://github.com/hogelog/kakasi-ruby/issues/2)

My application is Ruby 1.9.3, so I need to call kakasi-ruby from Ruby 1.9.3.

How should I do?

Do I have to open a subprocess with Ruby 1.8, and wait for it finish to get the process return value?

Edit: https://github.com/hogelog/kakasi-ruby


Solution

  • Found 3 possible paths:

    • There seems to be a branch for 1.9 in the repo. Maybe try to compile that instead?
    • Otherwise your fastest option is probably to go back to 1.8 depending on what kind of app it is.
    • Calling with 1.8 may work BUT since the library seems to be a binding to some C code you could probably call that code directly just as well.