# Has dl/import change in 1.9?

**URL:** <https://www.ruby-forum.com/t/has-dl-import-change-in-1-9/188396>\
**Category:** Ruby\
**Created:** [May 11, 2010, 10:51am UTC](https://www.ruby-forum.com/t/has-dl-import-change-in-1-9/188396 "2010-05-11T10:51:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sarmstrong2](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/58f4c7/32.png) [@sarmstrong2](https://www.ruby-forum.com/u/sarmstrong2)\
**Post date:** [May 11, 2010, 10:51am UTC](https://www.ruby-forum.com/t/has-dl-import-change-in-1-9/188396/1 "2010-05-11T10:51:51Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![sarmstrong2](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/58f4c7/32.png) [@sarmstrong2](https://www.ruby-forum.com/u/sarmstrong2)\
**Post date:** [May 11, 2010, 5:33pm UTC](https://www.ruby-forum.com/t/has-dl-import-change-in-1-9/188396/2 "2010-05-11T17:33:02Z")

</div>

> 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

---

<div class="post-metadata">

**Author:** ![sarmstrong2](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/58f4c7/32.png) [@sarmstrong2](https://www.ruby-forum.com/u/sarmstrong2)\
**Post date:** [May 13, 2010, 9:41am UTC](https://www.ruby-forum.com/t/has-dl-import-change-in-1-9/188396/3 "2010-05-13T09:41:12Z")

</div>

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
