jgorset/facebook-messenger

NameError: uninitialized constant Facebook

Closed this issue · 2 comments

Hello, everyone .I am trying to implement the bot for a rails but i keep getting this error.I followed the instructions and i made a folder bot/bot.rb with the code for the bot also added the line for subscription and requored 'facebook/messenger'. Added the lines at application.rb and the route.rb but when i try to push to heroku i get this error(couldnt find anything like it ).

NameError: uninitialized constant Facebook
remote: /tmp/build_d8f3bdc3fb5269409a853c7c41fca928/config/routes.rb:41:in block in <top (required)>' remote: /tmp/build_d8f3bdc3fb5269409a853c7c41fca928/vendor/bundle/ruby/2.4.0/gems/actionpack-5.1.6/lib/action_dispatch/routing/route_set.rb:436:in instance_exec'
remote: /tmp/build_d8f3bdc3fb5269409a853c7c41fca928/vendor/bundle/ruby/2.4.0/gems/actionpack-5.1.6/lib/action_dispatch/routing/route_set.rb:436:in eval_block' remote: /tmp/build_d8f3bdc3fb5269409a853c7c41fca928/vendor/bundle/ruby/2.4.0/gems/actionpack-5.1.6/lib/action_dispatch/routing/route_set.rb:418:in draw'
remote: /tmp/build_d8f3bdc3fb5269409a853c7c41fca928/config/routes.rb:1:in <top (required)>' remote: /tmp/build_d8f3bdc3fb5269409a853c7c41fca928/vendor/bundle/ruby/2.4.0/gems/railties-5.1.6/lib/rails/application/routes_reloader.rb:55:in block in load_paths'
remote: /tmp/build_d8f3bdc3fb5269409a853c7c41fca928/vendor/bundle/ruby/2.4.0/gems/railties-5.1.6/lib/rails/application/routes_reloader.rb:55:in each' remote: /tmp/build_d8f3bdc3fb5269409a853c7c41fca928/vendor/bundle/ruby/2.4.0/gems/railties-5.1.6/lib/rails/application/routes_reloader.rb:55:in load_paths'
remote: /tmp/build_d8f3bdc3fb5269409a853c7c41fca928/vendor/bundle/ruby/2.4.0/gems/railties-5.1.6/lib/rails/application/routes_reloader.rb:18:in reload!' remote: /tmp/build_d8f3bdc3fb5269409a853c7c41fca928/vendor/bundle/ruby/2.4.0/gems/railties-5.1.6/lib/rails/application/routes_reloader.rb:41:in block in updater'
remote: /tmp/build_d8f3bdc3fb5269409a853c7c41fca928/vendor/bundle/ruby/2.4.0/gems/activesupport-5.1.6/lib/active_support/file_update_checker.rb:81:in execute' remote: /tmp/build_d8f3bdc3fb5269409a853c7c41fca928/vendor/bundle/ruby/2.4.0/gems/railties-5.1.6/lib/rails/application/routes_reloader.rb:42:in updater'
remote: /tmp/build_d8f3bdc3fb5269409a853c7c41fca928/vendor/bundle/ruby/2.4.0/gems/railties-5.1.6/lib/rails/application/routes_reloader.rb:31:in execute_if_updated' remote: /tmp/build_d8f3bdc3fb5269409a853c7c41fca928/vendor/bundle/ruby/2.4.0/gems/railties-5.1.6/lib/rails/application/finisher.rb:128:in block in module:Finisher'
remote: /tmp/build_d8f3bdc3fb5269409a853c7c41fca928/vendor/bundle/ruby/2.4.0/gems/railties-5.1.6/lib/rails/initializable.rb:30:in instance_exec' remote: /tmp/build_d8f3bdc3fb5269409a853c7c41fca928/vendor/bundle/ruby/2.4.0/gems/railties-5.1.6/lib/rails/initializable.rb:30:in run'
remote: /tmp/build_d8f3bdc3fb5269409a853c7c41fca928/vendor/bundle/ruby/2.4.0/gems/railties-5.1.6/lib/rails/initializable.rb:59:in block in run_initializers' remote: /tmp/build_d8f3bdc3fb5269409a853c7c41fca928/vendor/bundle/ruby/2.4.0/gems/railties-5.1.6/lib/rails/initializable.rb:58:in run_initializers'
remote: /tmp/build_d8f3bdc3fb5269409a853c7c41fca928/vendor/bundle/ruby/2.4.0/gems/railties-5.1.6/lib/rails/application.rb:353:in initialize!' remote: /tmp/build_d8f3bdc3fb5269409a853c7c41fca928/config/environment.rb:5:in <top (required)>'
remote: /tmp/build_d8f3bdc3fb5269409a853c7c41fca928/vendor/bundle/ruby/2.4.0/gems/railties-5.1.6/lib/rails/application.rb:329:in require_environment!' remote: /tmp/build_d8f3bdc3fb5269409a853c7c41fca928/vendor/bundle/ruby/2.4.0/gems/railties-5.1.6/lib/rails/application.rb:445:in block in run_tasks_blocks'
remote: /tmp/build_d8f3bdc3fb5269409a853c7c41fca928/vendor/bundle/ruby/2.4.0/gems/sprockets-rails-3.2.1/lib/sprockets/rails/task.rb:62:in block (2 levels) in define' remote: /tmp/build_d8f3bdc3fb5269409a853c7c41fca928/vendor/bundle/ruby/2.4.0/gems/rake-12.3.1/exe/rake:27:in <top (required)>'

@tz3tzis I think you forgot to include facebook messenger module. Please add the following line on top of your bot.rb
include Facebook::Messenger

Yes indeed. Thanks @amrutjadhav!