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?
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?
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.
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
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.