Skip to content

app.rb code not finding my required files #9

@davidlbean

Description

@davidlbean

Hmmm...I refactored my largish app.rb into several files. At the top of my app.rb file, I try to require these other files, and ruby can't find them. I've tried

require './my_class.rb'

and

require_relative 'my_class.rb'

but neither seem to work. Here's what I get in the log files:

2017-01-21T00:28:06.308Z 7720d3b8-df70-11e6-89f4-35cd4eb32432 stderr:
: cannot load such file -- /var/task/lib/app/my_class.rb (LoadError)
from /var/task/lib/app/app.rb:5:in `<main>'

What's the proper way to reference my own code files from app.rb? Apologies if I'm missing something blatantly obvious to everyone else.

lorennorman: btw, thanks for creating this little package...it's super! I was forcing myself to jump through all sorts of node.js hoops and it was driving me crazy. I'm so much happier in the Ruby world.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions