I'm trying to use the Optiflag package in my Ruby code and whenever I try to do the necessary require optiflag.rb
, my program fails with the standard no such file to load -- optiflag
message. I added the directory with that library to my $PATH variable, but it's still not working. Any ideas?
views:
222answers:
2
+4
A:
is it a gem? Are you doing
require 'rubygems'
require 'optiflag'
or equivalent?
Purfideas
2008-09-10 02:02:45
Arg, I keep forgetting about that! Much thanks!
Chris Bunch
2008-09-10 02:05:35
+2
A:
It looks like it's a gem, so you need to enable ruby gems before requiring it.
This site explains many ways of how to do it. But to have the cheat sheet here these are:
1) Require the rubygems package before using a gem.
require "rubygems"
require "optiflag" # etc
2) Add the -rubygems flag to wherever you execute ruby. I.e:
ruby -rubygems Something.rb
3) Add an environment variable called RUBYOPT, giving it an option of rubygems. I.e:
RUBYOPT=rubygems
Daemin
2008-09-10 03:53:38