1

A helpful article on here recommended to call Ruby gems explicitly even though they are built-in.

So instead of

require 'minitest/autorun'
require_relative 'falcon'#file to test

I wrote

require 'rubygems'
gem 'minitest'
require 'minitest/autorun'
require_relative 'falcon'# file to test

The second syntax solved the problems I had.

I am now wondering if the second header is correct, i.e. whether there are any unnecessary repetitions in it.

the Tin Man
  • 158,662
  • 42
  • 215
  • 303
enahel
  • 355
  • 3
  • 15

1 Answers1

0

You should state your Ruby version too, as this will make it easier to find out the specific pattern of behaviour exhibited.

require 'rubygems' is no longer needed on more recent (~e. g. ~3 years old) Ruby versions.

To call Rubygems again explicitly makes no sense to me. Even if it were, I would consider this behavior a bug as the decision to integrate rubygems it was already made.

Rubygems comes bundled with default Ruby these days, the days of explicit require 'rubygems' ought to be over in my opinion.

the Tin Man
  • 158,662
  • 42
  • 215
  • 303
shevy
  • 920
  • 1
  • 12
  • 18
  • "on more recent (~e. g. ~3 years old) Ruby versions". To be specific, Ruby 1.9+ automatically does a `require "rubygems"` so only Ruby < 1.9 needs it. – the Tin Man Dec 07 '14 at 19:01