Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/62.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails Facebook身份验证在rails 3.2.3上引发了一个错误_Ruby On Rails_Facebook_Authentication_Devise_Omniauth - Fatal编程技术网

Ruby on rails Facebook身份验证在rails 3.2.3上引发了一个错误

Ruby on rails Facebook身份验证在rails 3.2.3上引发了一个错误,ruby-on-rails,facebook,authentication,devise,omniauth,Ruby On Rails,Facebook,Authentication,Devise,Omniauth,我设置了一个rails应用程序(3.2.3[Desive 3.4.1,omniauth facebook 2.0.0,omniauth 1.2.2])来使用facebook作为身份验证程序,我在尝试登录时遇到了这个问题。问题是,它甚至没有到达我的代码(控制器)。你知道这件事吗 奇怪的是,当我在主机上设置127.0.0.1 mydomain.com并浏览到mydomain.com:3000时,它工作了!虽然我在本地使用的是http而不是https类似于生产 Started GET "/users/

我设置了一个rails应用程序(3.2.3[Desive 3.4.1,omniauth facebook 2.0.0,omniauth 1.2.2])来使用facebook作为身份验证程序,我在尝试登录时遇到了这个问题。问题是,它甚至没有到达我的代码(控制器)。你知道这件事吗

奇怪的是,当我在主机上设置
127.0.0.1 mydomain.com
并浏览到
mydomain.com:3000
时,它工作了!虽然我在本地使用的是
http
而不是
https
类似于生产

Started GET "/users/auth/facebook" for x.x.x.x at 2015-02-12 00:45:05 +0000
Started GET "/users/auth/facebook/callback?code=xxxx" for 127.0.0.1 at 2015-02-12 00:45:05 +0000

URI::InvalidURIError (the scheme http does not accept registry part: app_server (or bad hostname?)):
  /home/deployer/.rbenv/versions/2.0.0-p195/lib/ruby/2.0.0/uri/generic.rb:214:in `initialize'
  /home/deployer/.rbenv/versions/2.0.0-p195/lib/ruby/2.0.0/uri/http.rb:84:in `initialize'
  /home/deployer/.rbenv/versions/2.0.0-p195/lib/ruby/2.0.0/uri/common.rb:214:in `new'
  /home/deployer/.rbenv/versions/2.0.0-p195/lib/ruby/2.0.0/uri/common.rb:214:in `parse'
  /home/deployer/.rbenv/versions/2.0.0-p195/lib/ruby/2.0.0/uri/common.rb:747:in `parse'
  omniauth (1.2.2) lib/omniauth/strategy.rb:416:in `full_host'

原来这是nginx代理的问题,我忘了转发给定位置的
Host
头。我刚刚设置了标题主机,一切都很顺利

proxy_set_header主机'example.com'