-1

So I'm still a bit confused at how load paths work basically I have a file structure like:

my_app
  bin
    my_bin
  lib
    processor.rb

So the problem is the the file my_bin is a bin file (in ruby) that is supposed to call a class and method in processor.rb

The bin file requires gems and other stuff at the top, but how can I have the classes in processor.rb loaded?

JP Silvashy
  • 46,977
  • 48
  • 149
  • 227
  • 1
    What have you tried so far? Did you try the answers to your previous question http://stackoverflow.com/questions/6671318/understanding-rubys-load-paths? – Andrew Grimm Jul 27 '11 at 03:29

1 Answers1

1

in 1.9.2 you can do:

require_relative '../lib/processor'

in 1.8.7 you can do:

$: << "/absolute/path/to_parent_of_lib/lib"

require 'processor'
ennuikiller
  • 46,381
  • 14
  • 112
  • 137