Skip to content
Karol Bucek edited this page Jan 22, 2016 · 4 revisions

Sinatra (and others)

Best Practices

LOAD_PATH

org.jruby.rack.RackInitializationException: no such file to load -- ...

Do not assume a lib (or any other folder) being on the $LOAD_PATH - make sure its properly added or use absolute requires.

# config.ru
require './lib/myapp.rb'

# lib/myapp.rb
require 'myapp/helpers' # won't work
require_relative 'myapp/helpers' # or
# $LOAD_PATH << File.expand_path('lib')
Clone this wiki locally