I am using Grape to build my API, and according to the documentation, I added the following lines to application.rb so that all
app/api` ruby scripts are added to the path, as well as allowing auto-reload for development mode:
config.paths.add "app/api", :glob => "**/*.rb"
config.autoload_paths += Dir["#{Rails.root}/app/api/*"]
I also added a piece of code in config/initializers as asked to. However, neither auto-reload nor the paths are working properly.
For the path, I need to explicitly add everything using require
at the main API file that I am using (I separated my Grape files into files + directories under app/api
. If I remove the require, I get:
NoMethodError
undefined method `call' for V1:Module
The auto-reload is also not working at all. It does not auto-reload when I change something.
What am I missing here?