views:

31

answers:

1

What technique does a ruby script use to find your libraries / requires on Windows.

I have an install of Ruby 1.8.7 on Windows to the path C:\Ruby187 and non of my "requires" work.

For example, just a test file

require "rack"

gives no such file to load -- rack (LoadError)

gem list rack is there

+1  A: 

Try

require 'rubygems'
require 'rack'

I believe that in Ruby 1.9+, you no longer have to require 'rubygems', but it is necessary on <= 1.8.

Otherwise, $: is the "Load path for scripts and binary modules by load or require".

Mark Rushakoff
weird. I have never had to do this before - but this is the first time that I think I have uninstalled 1.8.6 on a machine and then installed 1.8.7
tyndall
thanks. that worked. wonder why I have always not had to do this.
tyndall
just a note -you can also include the require statements in your .irbrc file which is why you might need to require rubygems on some user profiles and not on others or it may seem inconsistent.
Jed Schneider