Devise - Omniauth - FB Auth

Hi folks,

I am trying to add FB authentication to my site, I got it to work
locally, but I keep getting this error every time I push to heroku. I'm
not sure how/what to fix it, I guess it's coming from this section. I
tried to replace "app_domain" with my domain and it didn't work. Any
ideas?

Thanks in advance for any help!

I used this tutorial for Devise/Omniauth:
http://sourcey.com/rails-4-omniauth-using-devise-with-twitter-facebook-and-linkedin/

    # Email
  config.action_mailer.delivery_method = :smtp
  config.action_mailer.perform_deliveries = true
  config.action_mailer.default_url_options = { :host =>
config.app_domain }
  config.action_mailer.smtp_settings = {
    address: 'smtp.gmail.com',
    port: '587',
    enable_starttls_auto: true,
    user_name: 'someuser',
    password: 'somepass',
    authentication => :plain,
    domain => 'somedomain.com'
  }

Below is the error:

/usr/local/rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/railtie/configuration.rb:95:in
`method_missing': undefined method `app_domain' for
#<Rails::Application::Configuration:0x00000104f4c630> (NoMethodError)
  from
/Users/fatima/Desktop/floo/config/environments/development.rb:45:in
`block in <top (required)>'
  from
/usr/local/rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/railtie.rb:210:in
`instance_eval'
  from
/usr/local/rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/railtie.rb:210:in
`configure'
  from
/Users/fatima/Desktop/floo/config/environments/development.rb:1:in `<top
(required)>'
  from
/usr/local/rvm/gems/ruby-2.1.1/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in
`require'
  from
/usr/local/rvm/gems/ruby-2.1.1/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in
`block in require'
  from
/usr/local/rvm/gems/ruby-2.1.1/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:232:in
`load_dependency'
  from
/usr/local/rvm/gems/ruby-2.1.1/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in
`require'
  from
/usr/local/rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/engine.rb:594:in
`block (2 levels) in <class:Engine>'
  from
/usr/local/rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/engine.rb:593:in
`each'
  from
/usr/local/rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/engine.rb:593:in
`block in <class:Engine>'
  from
/usr/local/rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/initializable.rb:30:in
`instance_exec'
  from
/usr/local/rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/initializable.rb:30:in
`run'
  from
/usr/local/rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/initializable.rb:55:in
`block in run_initializers'
  from /usr/local/rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/tsort.rb:226:in
`block in tsort_each'
  from /usr/local/rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/tsort.rb:348:in
`block (2 levels) in each_strongly_connected_component'
  from /usr/local/rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/tsort.rb:418:in
`block (2 levels) in each_strongly_connected_component_from'
  from /usr/local/rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/tsort.rb:427:in
`each_strongly_connected_component_from'
  from /usr/local/rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/tsort.rb:417:in
`block in each_strongly_connected_component_from'
  from
/usr/local/rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/initializable.rb:44:in
`each'
  from
/usr/local/rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/initializable.rb:44:in
`tsort_each_child'
  from /usr/local/rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/tsort.rb:411:in
`call'
  from /usr/local/rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/tsort.rb:411:in
`each_strongly_connected_component_from'
  from /usr/local/rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/tsort.rb:347:in
`block in each_strongly_connected_component'
  from /usr/local/rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/tsort.rb:345:in
`each'
  from /usr/local/rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/tsort.rb:345:in
`call'
  from /usr/local/rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/tsort.rb:345:in
`each_strongly_connected_component'
  from /usr/local/rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/tsort.rb:224:in
`tsort_each'
  from /usr/local/rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/tsort.rb:205:in
`tsort_each'
  from
/usr/local/rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/initializable.rb:54:in
`run_initializers'
  from
/usr/local/rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/application.rb:288:in
`initialize!'
  from /Users/fatima/Desktop/floo/config/environment.rb:5:in `<top
(required)>'
  from
/usr/local/rvm/gems/ruby-2.1.1/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in
`require'
  from
/usr/local/rvm/gems/ruby-2.1.1/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in
`block in require'
  from
/usr/local/rvm/gems/ruby-2.1.1/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:232:in
`load_dependency'
  from
/usr/local/rvm/gems/ruby-2.1.1/gems/activesupport-4.1.1/lib/active_support/dependencies.rb:247:in
`require'
  from /Users/fatima/Desktop/floo/config.ru:3:in `block in <main>'
  from
/usr/local/rvm/gems/ruby-2.1.1/gems/rack-1.5.2/lib/rack/builder.rb:55:in
`instance_eval'
  from
/usr/local/rvm/gems/ruby-2.1.1/gems/rack-1.5.2/lib/rack/builder.rb:55:in
`initialize'
  from /Users/fatima/Desktop/floo/config.ru:in `new'
  from /Users/fatima/Desktop/floo/config.ru:in `<main>'
  from
/usr/local/rvm/gems/ruby-2.1.1/gems/rack-1.5.2/lib/rack/builder.rb:49:in
`eval'
  from
/usr/local/rvm/gems/ruby-2.1.1/gems/rack-1.5.2/lib/rack/builder.rb:49:in
`new_from_string'
  from
/usr/local/rvm/gems/ruby-2.1.1/gems/rack-1.5.2/lib/rack/builder.rb:40:in
`parse_file'
  from
/usr/local/rvm/gems/ruby-2.1.1/gems/rack-1.5.2/lib/rack/server.rb:277:in
`build_app_and_options_from_config'
  from
/usr/local/rvm/gems/ruby-2.1.1/gems/rack-1.5.2/lib/rack/server.rb:199:in
`app'
  from
/usr/local/rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/commands/server.rb:50:in
`app'
  from
/usr/local/rvm/gems/ruby-2.1.1/gems/rack-1.5.2/lib/rack/server.rb:314:in
`wrapped_app'
  from
/usr/local/rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/commands/server.rb:130:in
`log_to_stdout'
  from
/usr/local/rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/commands/server.rb:67:in
`start'
  from
/usr/local/rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/commands/commands_tasks.rb:81:in
`block in server'
  from
/usr/local/rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/commands/commands_tasks.rb:76:in
`tap'
  from
/usr/local/rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/commands/commands_tasks.rb:76:in
`server'
  from
/usr/local/rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/commands/commands_tasks.rb:40:in
`run_command!'
  from
/usr/local/rvm/gems/ruby-2.1.1/gems/railties-4.1.1/lib/rails/commands.rb:17:in
`<top (required)>'
  from /Users/fatima/Desktop/floo/bin/rails:8:in `require'
  from /Users/fatima/Desktop/floo/bin/rails:8:in `<top (required)>'
  from
/usr/local/rvm/gems/ruby-2.1.1/gems/spring-1.1.3/lib/spring/client/rails.rb:27:in
`load'
  from
/usr/local/rvm/gems/ruby-2.1.1/gems/spring-1.1.3/lib/spring/client/rails.rb:27:in
`call'
  from
/usr/local/rvm/gems/ruby-2.1.1/gems/spring-1.1.3/lib/spring/client/command.rb:7:in
`call'
  from
/usr/local/rvm/gems/ruby-2.1.1/gems/spring-1.1.3/lib/spring/client.rb:26:in
`run'
  from /usr/local/rvm/gems/ruby-2.1.1/gems/spring-1.1.3/bin/spring:48:in
`<top (required)>'
  from
/usr/local/rvm/gems/ruby-2.1.1/gems/spring-1.1.3/lib/spring/binstub.rb:11:in
`load'
  from
/usr/local/rvm/gems/ruby-2.1.1/gems/spring-1.1.3/lib/spring/binstub.rb:11:in
`<top (required)>'
  from /Users/fatima/Desktop/floo/bin/spring:16:in `require'
  from /Users/fatima/Desktop/floo/bin/spring:16:in `<top (required)>'
  from bin/rails:3:in `load'
  from bin/rails:3:in `<main>'

Where is your app_domain defined? This line here config.app_domain is culprit one.

Try somedomain.com

config.action_mailer.default_url_options = { :host => “somedomain.com” }

Thanks,

Shahroon

Thanks for the help Shahroon - I was able to set it by configuring it in
heroku. Turns out the tutorial I followed has some errors too, which I
was able to resolve with this one:
http://stackoverflow.com/questions/24272716/local-variable-or-method-config-for-mainobject-nameerror

Ok, great.