# $: from C or from ruby

**URL:** <https://rubytalk.org/t/from-c-or-from-ruby/46791>\
**Category:** ruby-talk\
**Created:** [29 May 2008 18:34 UTC](https://rubytalk.org/t/from-c-or-from-ruby/46791 "2008-05-29T18:34:54Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andre1](https://avatars.discourse-cdn.com/v4/letter/a/9fc29f/32.png) [@Andre1](https://rubytalk.org/u/Andre1)\
**Post date:** [29 May 2008 18:34 UTC](https://rubytalk.org/t/from-c-or-from-ruby/46791/1 "2008-05-29T18:34:54Z")

</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é
