<p>I'm trying to use the <a href="http://optiflag.rubyforge.org/discussion.html" rel="nofollow noreferrer">Optiflag</a> package in my Ruby code and whenever I try to do the necessary <code>require optiflag.rb</code>, my program fails with the standard <code>no such file to load -- optiflag</code> message. I added the directory with that library to my $PATH variable, but it's still not working. Any ideas?</p>

[{'answer_id': 53313, 'author': 'Purfideas', 'author_id': 4615, 'author_profile': 'https://Stackoverflow.com/users/4615', 'pm_score': 3, 'selected': True, 'text': "<p>is it a gem? Are you doing </p>\n\n<pre><code>require 'rubygems'\nrequire 'optiflag'\n</code></pre>\n\n<p>or equivalent?</p>\n"}, {'answer_id': 53390, 'author': 'Dominik Grabiec', 'author_id': 3719, 'author_profile': 'https://Stackoverflow.com/users/3719', 'pm_score': 2, 'selected': False, 'text': '<p>It looks like it\'s a gem, so you need to enable ruby gems before requiring it.</p>\n\n<p><a href="http://www.rubygems.org/read/chapter/3#page70" rel="nofollow noreferrer">This site</a> explains many ways of how to do it. But to have the cheat sheet here these are:</p>\n\n<p>1) Require the rubygems package before using a gem.</p>\n\n<pre><code>require "rubygems"\nrequire "optiflag" # etc\n</code></pre>\n\n<p>2) Add the -rubygems flag to wherever you execute ruby. I.e:</p>\n\n<pre><code>ruby -rubygems Something.rb\n</code></pre>\n\n<p>3) Add an environment variable called RUBYOPT, giving it an option of rubygems. I.e:</p>\n\n<pre><code>RUBYOPT=rubygems\n</code></pre>\n'}, {'answer_id': 8727718, 'author': 'MrFox', 'author_id': 351025, 'author_profile': 'https://Stackoverflow.com/users/351025', 'pm_score': 0, 'selected': False, 'text': "<p>I also keep having this problem with RubyXL, tried to use single and double quotes. Is there something else that needs to be done? Maybe putting a file somewhere? I already succesfully installed the gem with sudo gem install rubyXL (RubyXL actually din't work).</p>\n"}]
['https://Stackoverflow.com/questions/53292', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/422/']