# $: from C or from ruby

**URL:** <https://www.ruby-forum.com/t/from-c-or-from-ruby/138997>\
**Category:** Ruby\
**Created:** [May 29, 2008, 8:36pm UTC](https://www.ruby-forum.com/t/from-c-or-from-ruby/138997 "2008-05-29T20:36:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![AndrSSSS](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e99b99/32.png) [@AndrSSSS](https://www.ruby-forum.com/u/AndrSSSS)\
**Post date:** [May 29, 2008, 8:36pm UTC](https://www.ruby-forum.com/t/from-c-or-from-ruby/138997/1 "2008-05-29T20:36:02Z")

</div>

Hello,

I’m inspecting the value of $: (the ‘require’ path) under windows. If  
I do it from the ruby interpreter or irb, I get:

[“c:/devel/ruby/lib/ruby/site\_ruby/1.8”, “c:/devel/ruby/lib/ruby/  
site\_ruby/1.8/i386-msvcrt”, “c:/devel/ruby/lib/ruby/site\_ruby”, “c:/  
devel/ruby/lib/ruby/1.8”, “c:/devel/ruby/lib/ruby/1.8/i386-mswin32”,  
“.”]

which is the correct path. But if I do it from a C program where I am  
embedding the ruby interpreter (after calling ruby\_init() and  
ruby\_init\_loadpath()), I get:

[“C:/WINDOWS/system32/lib/ruby/site\_ruby/1.8”, “C:/WINDOWS/system32/  
lib/ruby/site\_ruby/1.8/i386-msvcrt”, “C:/WINDOWS/system32/lib/ruby/  
site\_ruby”, “C:/WINDOWS/system32/lib/ruby/1.8”, “C:/WINDOWS/system32/  
lib/ruby/1.8/i386-mswin32”, “.”]

which is WRONG, since it is replacing my ruby path (c:/devel/ruby) by  
the windows dll path (C:/WINDOWS/system32).

Why is that, and how can I correct this?

Regards,

Andr
