Requiring rubygems

I’m using the MySQL rubygem. In a code example in the book I’m
reading it has:

require ‘rubygems’
require ‘mysql’

in order to access the mysql functionality. However I tried it
without requiring rubygems and it still works. When do you have to
require rubygems when using a gem? What does requiring rubygems
actually accomplish?

Thanks,

Tim

Tim wrote:

I’m using the MySQL rubygem. In a code example in the book I’m
reading it has:

require ‘rubygems’
require ‘mysql’

in order to access the mysql functionality. However I tried it
without requiring rubygems and it still works. When do you have to
require rubygems when using a gem? What does requiring rubygems
actually accomplish?

Thanks,

Tim

http://docs.rubygems.org/read/book/1

On Thu, Mar 6, 2008 at 8:40 PM, Tim [email protected] wrote:

When do you have to
require rubygems when using a gem? What does requiring rubygems
actually accomplish?

You don’t need to require rubygems, if you defined the enviroment
variable RUBYOPT=-rubygem. RUBYOPT is not set on Windows if you
install Ruby with a normal user account.

Hi,

On Fri, Mar 7, 2008 at 8:18 AM, Thomas W.
[email protected]
wrote:

You don’t need to require rubygems, if you defined the enviroment
variable RUBYOPT=-rubygem. RUBYOPT is not set on Windows if you
install Ruby with a normal user account.

Or, if it was installed by your system’s packaging system directly.
e.g. installing libmysql-ruby on Debian-based systems.

Arlen