- These are my gems.
gem 'devise'
gem 'omniauth-facebook','~> 4.0'
- This is the code I have in my devise.rb
config.omniauth :facebook, ENV['FACEBOOK_APPLICATION_ID'], ENV['FACEBOOK_APPLICATION_SECRET'], scope: 'public_profile,email'
- This is my .env
export FACEBOOK_APPLICATION_ID=<appid>
export FACEBOOK_APPLICATION_SECRET=<appsecret>
- I also tried removing the export from the above statements.
FACEBOOK_APPLICATION_ID=<appid>
FACEBOOK_APPLICATION_SECRET=<appsecret>
- This is my Facebook application settings.

The same thing works on x branch of my project but the same credentials does not work on the branch y of my git project.
This is the error I get.
Invalid app ID
The provided app ID does not look like a valid app ID.
While merging my branch with another it took another branch's omniauth.rb file in the config folder which I think internally overwrote devise.rb and hence did not work. It was a very very silly error from my end. Thankyou to everyone who answered.