更新后,我得到“错误数量的参数(3 对 2)";对于任何请求 [英] After update I get "wrong number of arguments (3 for 2)" for any request

查看:42
本文介绍了更新后,我得到“错误数量的参数(3 对 2)";对于任何请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

更新任何对我的 rails 更新的请求后,我收到此错误:

After An update any request to my rails update I get this error:

wrong number of arguments (3 for 2)

没有任何明显的痕迹是:

Theres nothing obvious in the trace which is:

rack (1.2.2) lib/rack/builder.rb:54:in `initialize'
rack (1.2.2) lib/rack/builder.rb:54:in `new'
rack (1.2.2) lib/rack/builder.rb:54:in `use'
rack (1.2.2) lib/rack/builder.rb:73:in `call'
rack (1.2.2) lib/rack/builder.rb:73:in `to_app'
activesupport (3.0.4) lib/active_support/dependencies.rb:239:in `inject'
rack (1.2.2) lib/rack/builder.rb:73:in `each'
rack (1.2.2) lib/rack/builder.rb:73:in `inject'
rack (1.2.2) lib/rack/builder.rb:73:in `to_app'
oa-core (0.2.5) lib/omniauth/builder.rb:30:in `call'
actionpack (3.0.4) lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
actionpack (3.0.4) lib/action_dispatch/middleware/head.rb:14:in `call'
rack (1.2.2) lib/rack/methodoverride.rb:24:in `call'
actionpack (3.0.4) lib/action_dispatch/middleware/params_parser.rb:21:in `call'
actionpack (3.0.4) lib/action_dispatch/middleware/flash.rb:182:in `call'
actionpack (3.0.4) lib/action_dispatch/middleware/session/abstract_store.rb:149:in `call'
actionpack (3.0.4) lib/action_dispatch/middleware/cookies.rb:302:in `call'
activerecord (3.0.4) lib/active_record/query_cache.rb:32:in `call'
activerecord (3.0.4) lib/active_record/connection_adapters/abstract/query_cache.rb:28:in `cache'
activerecord (3.0.4) lib/active_record/query_cache.rb:12:in `cache'
activerecord (3.0.4) lib/active_record/query_cache.rb:31:in `call'
activerecord (3.0.4) lib/active_record/connection_adapters/abstract/connection_pool.rb:354:in `call'
actionpack (3.0.4) lib/action_dispatch/middleware/callbacks.rb:46:in `call'
activesupport (3.0.4) lib/active_support/callbacks.rb:415:in `_run_call_callbacks'
actionpack (3.0.4) lib/action_dispatch/middleware/callbacks.rb:44:in `call'
rack (1.2.2) lib/rack/sendfile.rb:107:in `call'
actionpack (3.0.4) lib/action_dispatch/middleware/remote_ip.rb:48:in `call'
actionpack (3.0.4) lib/action_dispatch/middleware/show_exceptions.rb:47:in `call'
railties (3.0.4) lib/rails/rack/logger.rb:13:in `call'
rack (1.2.2) lib/rack/runtime.rb:17:in `call'
activesupport (3.0.4) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
rack (1.2.2) lib/rack/lock.rb:11:in `call'
rack (1.2.2) lib/rack/lock.rb:11:in `synchronize'
rack (1.2.2) lib/rack/lock.rb:11:in `call'
actionpack (3.0.4) lib/action_dispatch/middleware/static.rb:30:in `call'
railties (3.0.4) lib/rails/application.rb:168:in `call'
railties (3.0.4) lib/rails/application.rb:77:in `send'
railties (3.0.4) lib/rails/application.rb:77:in `method_missing'
/Users/arcath/Library/Application Support/Pow/Versions/0.2.2/node_modules/nack/lib/nack/server.rb:146:in `handle'
/Users/arcath/Library/Application Support/Pow/Versions/0.2.2/node_modules/nack/lib/nack/server.rb:99:in `start'
/Users/arcath/Library/Application Support/Pow/Versions/0.2.2/node_modules/nack/lib/nack/server.rb:86:in `each'
/Users/arcath/Library/Application Support/Pow/Versions/0.2.2/node_modules/nack/lib/nack/server.rb:86:in `start'
/Users/arcath/Library/Application Support/Pow/Versions/0.2.2/node_modules/nack/lib/nack/server.rb:66:in `loop'
/Users/arcath/Library/Application Support/Pow/Versions/0.2.2/node_modules/nack/lib/nack/server.rb:66:in `start'
/Users/arcath/Library/Application Support/Pow/Versions/0.2.2/node_modules/nack/lib/nack/server.rb:13:in `run'
/Users/arcath/Library/Application Support/Pow/Versions/0.2.2/node_modules/nack/bin/nack_worker:4

捆绑更新的结果是:

> bundle update
Fetching source index for http://rubygems.org/
Using rake (0.8.7) 
Using aaronh-chronic (0.3.9) 
Using abstract (1.0.0) 
Using activesupport (3.0.4) 
Using builder (2.1.2) 
Using i18n (0.5.0) 
Using activemodel (3.0.4) 
Using erubis (2.6.6) 
Using rack (1.2.2) 
Using rack-mount (0.6.14) 
Using rack-test (0.5.7) 
Using tzinfo (0.3.27) 
Using actionpack (3.0.4) 
Using mime-types (1.16) 
Using polyglot (0.3.1) 
Using treetop (1.4.9) 
Using mail (2.2.19) 
Using actionmailer (3.0.4) 
Installing arel (2.0.10) 
Using activerecord (3.0.4) 
Using activeresource (3.0.4) 
Using addressable (2.2.4) 
Using bundler (1.0.13) 
Using cancan (1.6.4) 
Using coderay (0.9.8) 
Using diff-lcs (1.1.2) 
Using multipart-post (1.1.1) 
Using faraday (0.6.1) 
Using growl (1.0.3) 
Using thor (0.14.6) 
Using guard (0.3.4) 
Using guard-rspec (0.3.1) 
Using gyoku (0.4.4) 
Using pyu-ntlm-http (0.1.3.1) 
Using httpi (0.9.4) 
Using railties (3.0.4) 
Using jquery-rails (1.0.5) 
Using meta_search (1.0.5) 
Using meta_where (1.0.4) 
Using mocha (0.9.12) 
Using multi_json (1.0.2) 
Using multi_xml (0.2.2) 
Using mysql (2.8.1) 
Using net-ldap (0.2.2) 
Using nifty-generators (0.4.6) 
Using nokogiri (1.4.4) 
Using nori (0.2.2) 
Using oa-core (0.2.5) 
Using rest-client (1.6.1) 
Using oa-basic (0.2.5) 
Using pyu-ruby-sasl (0.0.3.2) 
Using rubyntlm (0.1.1) 
Using oa-enterprise (0.2.5) 
Using oa-more (0.2.5) 
Using oauth (0.4.4) 
Using oauth2 (0.4.1) 
Using oa-oauth (0.2.5) 
Using ruby-openid (2.1.8) 
Using rack-openid (1.3.1) 
Using ruby-openid-apps-discovery (1.2.0) 
Using oa-openid (0.2.5) 
Using omniauth (0.2.5) 
Using rails (3.0.4) 
Using rb-fsevent (0.4.0) 
Using rspec-core (2.6.0) 
Using rspec-expectations (2.6.0) 
Using rspec-mocks (2.6.0) 
Using rspec (2.6.0) 
Using rspec-rails (2.6.0) 
Using savon (0.9.2) 
Using sqlite3 (1.3.3) 
Installing trainbbcode (1.2.0) 
Using whenever (0.6.7) 
Your bundle is updated! Use `bundle show [gemname]` to see where a bundled gem is installed.

我的 Omniauth 初始化程序:

My Omniauth Initilaizer:

Rails.application.config.middleware.use OmniAuth::Builder do
    provider :LDAP, "Ed-ITLDAP", :host => LDAP_HOST, :port => LDAP_PORT, :method => 'plain', :base => LDAP_BASE, :uid =>  'sAMAccountName', :try_sasl => true, :sasl_mechanisms => "GSS-SPNEGO"
end

<小时>

Omniauth 似乎不再需要/需要提供者的名称,因此在我的情况下,我从提供者行中删除了EDITLDAP"选项,如下所示:


Omniauth seems to longer want/need the name of the provider so in my case I removed the "EDITLDAP" option from the provider line like this:

Rails.application.config.middleware.use OmniAuth::Builder do
    provider :LDAP, :host => LDAP_HOST, :port => LDAP_PORT, :method => 'plain', :base => LDAP_BASE, :uid =>  'sAMAccountName', :try_sasl => true, :sasl_mechanisms => "GSS-SPNEGO"
end

推荐答案

@Arcath:检查您使用的任何中间件是否使用正确的语法.我遇到了同样的问题,问题是我的 config.ru 有

@Arcath: check that any middleware you're using is using the right syntax. I had the same problem and the issue was that my config.ru had

use Rails::Rack::Static

现在在 Rails 3 中:

which in Rails 3 is now:

use Rack::Static

HTH

这篇关于更新后,我得到“错误数量的参数(3 对 2)";对于任何请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆