From: James Edward Gray II Date: 2005-07-26T22:21:03+09:00 Subject: Ruby "Classpath" (was blank) On Jul 26, 2005, at 7:40 AM, Adrian Petru Dimulescu wrote: > Hello, > > This must have been already asked but I can't find anyhting the > ruby-talk archives: > > What's the ruby equivalent of java classpath ? How can i print in a > ruby script this "classpath" ? I believe you are looking for the $: variable (or the alias $LOAD_PATH): irb(main):001:0> $: => ["/usr/local/lib/ruby/site_ruby/1.8", "/usr/local/lib/ruby/ site_ruby/1.8/powerpc-darwin7.7.0", "/usr/local/lib/ruby/site_ruby", "/usr/local/lib/ruby/1.8", "/usr/local/lib/ruby/1.8/powerpc- darwin7.7.0", "."] irb(main):002:0> $LOAD_PATH => ["/usr/local/lib/ruby/site_ruby/1.8", "/usr/local/lib/ruby/ site_ruby/1.8/powerpc-darwin7.7.0", "/usr/local/lib/ruby/site_ruby", "/usr/local/lib/ruby/1.8", "/usr/local/lib/ruby/1.8/powerpc- darwin7.7.0", "."] They're basically Arrays so you can push/unshift new entries. The Ruby command-line option -I will also add directories. Hope that helps. James Edward Gray II