I have created a simple app and this is my folder structure
- lib/book.rb
- lib/user.rb
- server.rb <- main sinatra file
And this is my config.ru
require './server'
run Sinatra::Application
When I deploy to heroku I got this error `require’: no such file to load — lib/book (LoadError). However, on my local machine it works fine.
I’m not sure what to include in config.ru I tried require ‘./lib/book’ as well, but it didn’t work.
Thanks a lot.
You could try to add the /lib directory to your
$LOAD_PATHby adding something like this to yourserver.rb:This will add the /lib directory to your
$LOAD_PATHand require all *.rb files in it.