Make sure you set environment variables. The Railscast manual requires your App ID/API Key and App Secret be set as environment variables, so the omniauth initializer can connect
provider :facebook, ENV['APP_ID'], ENV['APP_SECRET']
For this:
export APP_ID=(YOUR APP ID) export APP_SECRET=(YOUR SECRET KEY)
Two other routes for this is to create config.yml in your config / directory using
development: app_id: 'YOUR APP ID' app_secret: 'YOUR SECRET KEY'
Add this to your config / application.rb
AppConfig = YAML.load(ERB.new(File.read(File.expand_path('../config.yml', __FILE__))).result)[Rails.env] AppConfig.symbolize_keys!
Then specify them in your initializer using AppConfig[:app_secret] and AppConfig[:app_id]
The last option is to simply copy the values ββto the provider and remove the ENV
provider :facebook, 'YOUR APP ID', 'YOUR SECRET KEY'
The second option is most preferred.
source share