更新后,我得到任何请求“错误的参数数量(3个2)”

时间:2011-05-18 12:28:38

标签: ruby ruby-on-rails-3

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

wrong number of arguments (3 for 2)

在痕迹中没有明显的:

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.

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”选项,如下所示:

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

1 个答案:

答案 0 :(得分:0)

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

use Rails::Rack::Static

现在在Rails 3中:

use Rack::Static

HTH