Ruby 如何调试Omniauth和Rack应用程序?

Ruby 如何调试Omniauth和Rack应用程序?,ruby,debugging,gem,rack,Ruby,Debugging,Gem,Rack,我正在尝试使用Rack+omniauth(事实上是-omniauth-eBay)通过eBay进行身份验证。我有一个正确的配置(而不是“111”、“222”…有实际值): 当我转到localhost:9292/auth/ebay时,我收到一个错误: NoMethodError at /auth/ebay undefined method `[]' for nil:NilClass file: ebay_api.rb location: generate_session_id

我正在尝试使用Rack+omniauth(事实上是-omniauth-eBay)通过eBay进行身份验证。我有一个正确的配置(而不是“111”、“222”…有实际值):

当我转到l
ocalhost:9292/auth/ebay
时,我收到一个错误:

    NoMethodError at /auth/ebay
    undefined method `[]' for nil:NilClass
    file: ebay_api.rb location: generate_session_id line: 21

 #....
omniauth.error  - <NoMethodError: undefined method `[]' for nil:NilClass>
omniauth.error.strategy - #<OmniAuth::Strategies::Ebay>
omniauth.error.type - "Failed to retrieve session id from ebay"
omniauth.strategy - <OmniAuth::Strategies::Ebay>
NoMethodError位于/auth/ebay
nil:NilClass的未定义方法“[]”
文件:ebay\u api.rb位置:生成会话\u id行:21
#....

omniauth.error-omniauth易趣使用纯XML版本的易趣API,而不是SOAP版本。您的最后一个配置值应为

https://api.sandbox.ebay.com/ws/api.dll
不是


另外,根据您的错误,您似乎安装了omniauth ebay gem的早期版本。在中,有更多的错误检查,应该会提供更多详细信息。

没错,url现在是正确的。但我使用的是最新版本,我刚刚安装了它。但现在它将我重定向到生产登录url,该url为。如何使用沙盒url-?不幸的是,这个值是硬编码的。您可以在本地更改此
EBAY\u登录\u URL
我试图设置
EbayAPI::EBAY\u登录\u URL=“signin.sandbox.ebay.com/ws/eBayISAPI.dll
紧跟在config.rb中使用OmniAuth::Builder do…
。它将我重定向到
http://localhost:9292/auth/signin.sandbox.ebay.com/ws/eBayISAPI.dll?....
哪个是错误的。我是否应该在另一个地方调用
EbayAPI::EBAY\u LOGIN\u URL=…
?你的想法是什么?看起来这里的迷你降价编辑器去掉了https://。将易趣登录URL设置为
https://signin.sandbox.ebay.com/ws/eBayISAPI.dll
https://api.sandbox.ebay.com/ws/api.dll
https://api.sandbox.ebay.com/wsapi