In your facebook app setup do

App Domain =>

in your /etc/hosts

in a shell script

sudo ssh -L 80:localhost:3000 -l `whoami` -N localhost

When this script is run then it will block. Press ^C to stop the port forwarding. This could be made into a rake task if you like

What the above does is tell facebook to authorize an application operating at the * uri pattern. In our /etc/hosts we map to the loopback device and in the shell script we forward port 80 to the real port our rails app runs on. Last of all we need to configure OAuth in our OmniAuth in our rails app to use the correct end points depending on our environment.

if Rails.env.production?
  OmniAuth.config.full_host = ""
elsif Rails.env.test?
  OmniAuth.config.full_host = ""
elsif Rails.env.development?
  OmniAuth.config.full_host = ""

If you are using http rather than https then change the http to http above.