最近在自己的 project 里面用omniauth-weibo-oauth2
加上了 weibo 登陆,在 dev 和 staging(staging 是房间里的另一台机器,和 dev 网络环境是一样的,但是系统环境是跟 production 一样的) 上都没有什么问题。但是步部署到 production 环境 (是在 linode tokyo 的 vps) 上之后,weibo 登陆点击授权之后就会出现:
Started GET "/auth/weibo/callback?state=f87bf3cbe5cea5e15f90df8c76e11f0f65ebfbd9333c557a&code=63809670a226bc5cfdcae0f128e8f722" for 173.224.215.131 at 2012-08-22 12:03:34 +0800
Faraday::Error::ConnectionFailed (end of file reached):
/usr/local/rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/openssl/buffering.rb:145:in `sysread_nonblock'
/usr/local/rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/openssl/buffering.rb:145:in `read_nonblock'
/usr/local/rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/net/protocol.rb:135:in `rbuf_fill'
然后我在生产环境rails console
也手动试验了一下,
$ bundle exec rails c production
Loading production environment (Rails 3.2.3)
1.9.2p320 :001 > @conn = Faraday.new(:url => 'https://api.weibo.com') do | c|
1.9.2p320 :002 > c.use Faraday::Request::UrlEncoded
1.9.2p320 :003?> c.use Faraday::Response::Logger
1.9.2p320 :004?> c.use Faraday::Adapter::NetHttp
1.9.2p320 :005?> end
=> #<Faraday::Connection:0x00000005d60998 @headers={}, @params={}, @options={}, @ssl={}, @parallel_manager=nil, @default_parallel_manager=nil, @builder=#<Faraday::Builder:0x00000005d60830 @handlers=[Faraday::Request::UrlEncoded, Faraday::Response::Logger, Faraday::Adapter::NetHttp]>, @url_prefix=#<URI::HTTPS:0x00000005d60560 URL:https://api.weibo.com/>, @proxy=nil>
1.9.2p320 :006 > response = @conn.get '/auth/weibo/callback?state=f87bf3cbe5cea5e15f90df8c76e11f0f65ebfbd9333c557a&code=63809670a226bc5cfdcae0f128e8f722'
get https://api.weibo.com/auth/weibo/callback?state=f87bf3cbe5cea5e15f90df8c76e11f0f65ebfbd9333c557a&code=63809670a226bc5cfdcae0f128e8f722
迟迟得不到返回。
想问一下有用 Linode Tokyo 的朋友也碰到这样的情况么?这是因为 Linode Tokoy -> Weibo 的网络问题导致的么?
求教