diff --git "a/C:\\Users\\LAZARI~1\\AppData\\Local\\Temp\\gem1630.rb" "b/P:\\sand\\rubyi2\\sandbox\\ruby193\\gem_prelude.rb" index 3d4516f..9daa619 100644 --- "a/C:\\Users\\LAZARI~1\\AppData\\Local\\Temp\\gem1630.rb" +++ "b/P:\\sand\\rubyi2\\sandbox\\ruby193\\gem_prelude.rb" @@ -1 +1,27 @@ -require 'rubygems.rb' if defined?(Gem) +begin + require 'rubygems.rb' if defined?(Gem) +rescue LoadError + + #the current file directory (= source-tree-root) + fdir = File.dirname(__FILE__) + + #add ./.ext/RUBY_PLATFORM thus external binary libraries work + $LOAD_PATH << File.expand_path(File.join(".ext", RUBY_PLATFORM), fdir ) + + #add "lib", so it finds rubygems.rb (and other libraries) + $LOAD_PATH << File.expand_path(File.join("lib"), fdir ) + + #add current file-dir, thus require "rbconfig.rb" works + $LOAD_PATH << File.expand_path(fdir) + + #add ./.ext/common thus external libraries work + $LOAD_PATH << File.expand_path(File.join(".ext","common"), fdir ) + + #puts "\nActual library paths:" + #puts "---------------------" + #$LOAD_PATH.each { |i| p i } + #puts "---------------------" + + require 'rubygems.rb' if defined?(Gem) + +end