From: Christian Neukirchen Date: 2005-03-29T04:51:32+09:00 Subject: Re: RUBYOPT="rubygems" doesn't feel good... "Erik Veenstra" writes: >> You don't need to have gems installed; you can simply install >> the libraries (assuming they have the same name as the gems). >> And, you don't need to have RUBYOPTS set. > > Oh, I see what you mean... But it's not what I'm talking about. > That's why I was a bit confused. > > I, the customer have installed RubyGems, as well as the gems on > which the application depends, but I didn't set RUBYOPT. When > you, the developer, give me an application which doesn't > require rubygems internally, it's not going to run on my > machine. Is it? You could easily avoid that by doing a "require > 'rubygems'" internally. There's no need to rescue it. The issue is that I for myself, the developer do not use rubygems. But your statement is correct: If you want to use software that doesn't require 'rubygems' for reasons whatsoever, you'll need to set RUBYOPT or run the program with -rubygems. > You're talking about whether I, the customer, need to install > RubyGems at all. You could avoid that "have to" by rescuing the > "require 'rubygems'". Well, in theory, but no in practice. See > the examples. This works in practice too. > "In theory there is no difference between theory and practice. > In practice there is."... > > gegroet, > Erik V. > > # Example 1 > require "rubygems" > require "sqlite" > > # Example 2 > $: << "/usr/lib/ruby/gems/1.8/gems/sqlite-ruby-2.2.3/lib/" > require "sqlite" On *my* box, Example 2 will run, as sqlite is likely to be installed elsewhere. Do not ever do that, though. If you want to use a gem on your box, use a captured require 'rubygems'. -- Christian Neukirchen http://chneukirchen.org