Hey folks,
Help is needed.
I have a rails 3.2.13 app running on ruby 1.9.3.
I have added app/api/api.rb
require 'grape'
module Chat
class API < Grape::API
end
end
and my paths to application.rb
module Chatti
class Application < Rails::Application
config.paths.add "app/api", glob: "**/*.rb"
config.autoload_paths += Dir["#{Rails.root}/app/api/*"]
.....
My routes.rb file is
Chatti::Application.routes.draw do
mount Chat::API => '/api'
end
when I run my rails server I get the following error, does anybody know how to fix this?? Many thanks!
john@john-Precision-M4600:~/workspace/chatti$ rails server
=> Booting WEBrick
=> Call with -d to detach
=> Ctrl-C to shutdown server
Exiting
/home/john/workspace/chatti/config/routes.rb:3:in `block in <top (required)>': uninitialized constant Chat (NameError)
from /home/john/.rvm/gems/ruby-1.9.3-p286/gems/actionpack-3.2.13/lib/action_dispatch/routing/route_set.rb:289:in `instance_exec'
from /home/john/.rvm/gems/ruby-1.9.3-p286/gems/actionpack-3.2.13/lib/action_dispatch/routing/route_set.rb:289:in `eval_block'
from /home/john/.rvm/gems/ruby-1.9.3-p286/gems/actionpack-3.2.13/lib/action_dispatch/routing/route_set.rb:267:in `draw'
from /home/john/workspace/chatti/config/routes.rb:1:in `<top (required)>'
from /home/john/.rvm/gems/ruby-1.9.3-p286/gems/railties-3.2.13/lib/rails/application/routes_reloader.rb:40:in `block in load_paths'