# Ruby\_init\_loadpath() vs Win32

**URL:** <https://rubytalk.org/t/ruby-init-loadpath-vs-win32/60071>\
**Category:** ruby-talk\
**Created:** [15 September 2010 12:30 UTC](https://rubytalk.org/t/ruby-init-loadpath-vs-win32/60071 "2010-09-15T12:30:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Phlip1](https://avatars.discourse-cdn.com/v4/letter/p/df788c/32.png) [@Phlip1](https://rubytalk.org/u/Phlip1)\
**Post date:** [15 September 2010 12:30 UTC](https://rubytalk.org/t/ruby-init-loadpath-vs-win32/60071/1 "2010-09-15T12:30:11Z")

</div>

If I set RUBYLIB to "C:\phlip\tools\ruby-1.9.1-p0\" before running an  
embedded project - linked via Visual Studio to freshly-built LIBs in  
that build tree - I get $: load paths with site\_ruby off in evil-land:

["C:\\phlip\\tools\\ruby-1.9.1-p0\\",  
"C:/WINDOWS/system32/lib/ruby/site\_ruby/1.9.1",  
"C:/WINDOWS/system32/lib/ruby/site\_ruby/1.9.1/i386-msvcr80",  
"C:/WINDOWS/system32/lib/ruby/site\_ruby"... ]

site\_ruby is neither there nor in the build tree. Then, naturally,  
require 'rubygems' fails, and so on.

Please go easy on me, because I only have 10 years experience with  
Ruby and 20 with C++...

> **···**
>
> --  
> &nbsp;&nbsp;Phlip

---

<div class="post-metadata">

**Author:** ![Luis\_Lavena1](https://avatars.discourse-cdn.com/v4/letter/l/f08c70/32.png) [@Luis\_Lavena1](https://rubytalk.org/u/Luis_Lavena1)\
**Post date:** [15 September 2010 15:35 UTC](https://rubytalk.org/t/ruby-init-loadpath-vs-win32/60071/2 "2010-09-15T15:35:08Z")

</div>

Are you linking to a shared library of ruby or statically linked?

Is VARIABLE\_LIBPATH defined?

If not, then it grabs the path of where the shared library is located.

Perhaps that could lead to something?

(guessing after quick looking at the C code)

> **···**
>
> On Sep 15, 9:28 am, Phlip \<phlip2...@gmail.com\> wrote:
> 
> > If I set RUBYLIB to "C:\phlip\tools\ruby-1.9.1-p0\" before running an  
> > embedded project - linked via Visual Studio to freshly-built LIBs in  
> > that build tree - I get $: load paths with site\_ruby off in evil-land:
> > 
> > ["C:\\phlip\\tools\\ruby-1.9.1-p0\\",  
> > "C:/WINDOWS/system32/lib/ruby/site\_ruby/1.9.1",  
> > "C:/WINDOWS/system32/lib/ruby/site\_ruby/1.9.1/i386-msvcr80",  
> > "C:/WINDOWS/system32/lib/ruby/site\_ruby"... ]
> > 
> > site\_ruby is neither there nor in the build tree. Then, naturally,  
> > require 'rubygems' fails, and so on.
> > 
> > Please go easy on me, because I only have 10 years experience with  
> > Ruby and 20 with C++...
> 
> --  
> Luis Lavena
