I have following task - create single file from gem for executing it on
dedicated server. I have implemented recursive walk of files tree. Main
problem that order of files list i extracted from gem is wrong, i.e
but when i’m trying to merge these files into one in this precedence on
file load i’m receiving NameError due to wrong files order.Any ideas how
i could get proper list of gem files or make dependency graph, or export
gem in single huge file?
Did you mean to have a leading slash on your require statement? That
implies
you installed it in your root dir (which is probably not a good place
for
it), I’d personally let Rubygems handle installation and location of
gems,
in fact I did, and when I ran your code (on 1.9.1) I didn’t get any
errors.
But, to answer your question, looking at the gem, you can just require
the
lib and it will require all those files for you:
So you could just replace your three lines with:
require(“simple_record”)
which also worked for me.
This is a fairly common convention, you can check out the gem’s source
code
with $ gem open simple_record (you’ll first need to $ gem install gem-open)
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.