Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
require_relative in
require_relative './mylib'
run ->(env){ [200, {}, ['']] }
# I'm just required
#=> /Users/tjsingleton/tmp/rack_relative/ `require_relative': cannot infer basepath (LoadError)
Copy link

tjsingleton commented Jul 9, 2013

This is because the rackup file is eval'd

ruby -e 'eval("require_relative %[./mylib]")'
-e:1:in `eval': cannot infer basepath (LoadError)
    from (eval):1:in `<main>'
    from -e:1:in `eval'
    from -e:1:in `<main>'

Copy link

jikkujose commented Aug 29, 2014

So, whats the solution for this?

Copy link

liul85 commented Sep 3, 2014

Update your ruby version to 2.1.0. will be fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment