Hi.
I’m trying to run some pre-1.9 code along these lines:
require ‘dl/import’
module C
extend DL::Importable
end
However I’m getting an ‘uninitialized constant DL::Importable
(NameError)’.
Is DL::Importable defined differently in 1.9 or am I being stupid? I’m
running the code on OS/X.
Many thanks.
Steve
Is DL::Importable defined differently in 1.9 or am I being stupid? I’m
running the code on OS/X.
Yep it’s changed. For me this meant I had to update my net/ssh gem to
the latest version, so looking at net/ssh’s commits might yield some
clues.
Anybody can post something helpful in that regard?
thanks.
-rp
Quick update after poking around in the dl folder in ruby/lib.
DL::Importable is gone. Use DL::Importer instead.
You can’t pass nil into methods, I had to use DL::TYPE_VOID (something
like that, can’t remember exact syntax off top of my head).
I had to change a few things to CPtr, which I assume is new, to get them
to work.
In conclusion if you have any dl code written for Ruby 1.8 - update to
DL::Importer and you should be able to fix the rest using the error
messages.
Steve