0

I replaced rvm with rbenv on my Macbook and after doing so I've needed to add require 'rubygems' to things to get them working.

Is there a way of forcing rubygems to be required, or removing the need for it?

Arcath
  • 4,331
  • 9
  • 39
  • 71
  • Even if there is, then your decision will depend on whether other people need to use your code. Do you want to force them to change their environment to match yours before they can use your code? – Gareth Jul 06 '12 at 09:54
  • 2
    Did you install Ruby 1.9 with rbenv? Are you sure it's being used, and not the system Ruby? 1.8 doesn't auto-require RubyGems. – echristopherson Jul 06 '12 at 13:39

1 Answers1

1

For sanity reasons you should always require what you need. As rubygems is included by default in ruby 1.9 you should do something like:

require 'rubygems' unless defined?(Gem)

at the top of your script.

calas
  • 1,603
  • 1
  • 12
  • 15