From: Stefano Crocco Date: 2009-02-20T16:26:33+09:00 Subject: Re: load a path (not a file) Alle Friday 20 February 2009, Elias Orozco ha scritto: > Hello guys, > > I need to load a path not a file. I am trying this but it is not working > > load RAILS_ROOT+"/public/users/#{self.login}/lib/" > > Can you guys help me, > > Thanks What do you mean by "load a path"? A path isn't a ruby file, so you can't load it. If you mean "load all ruby files contained in a directory", you can do something like this: dir = RAILS_ROOT+"/public/users/#{self.login}/lib/" Dir.entries(d).each do |f| load File.join(d, f) if file.match(/\.rb$/) end Stefano