基本上,我按照这些说明添加自定义omniauth 提供程序:
我想使用omniauth-pam:
https://github.com/nickcharlton/omniauth-pam
添加 gem 并在 gitlab.yml 中配置后:
providers:
- { name: 'pam' }
它不再以这个错误开始:
Received wrong number of arguments. [nil, nil] (ArgumentError)
/sync1/gitlab/vendor/bundle/ruby/2.0.0/gems/omniauth-1.1.4/lib/omniauth/strategy.rb:143:in `initialize'
/sync1/gitlab/vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.15/lib/action_dispatch/middleware/stack.rb:43:in `new'
/sync1/gitlab/vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.15/lib/action_dispatch/middleware/stack.rb:43:in `build'
/sync1/gitlab/vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.15/lib/action_dispatch/middleware/stack.rb:113:in `block in build'
/sync1/gitlab/vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.15/lib/action_dispatch/middleware/stack.rb:113:in `each'
/sync1/gitlab/vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.15/lib/action_dispatch/middleware/stack.rb:113:in `inject'
/sync1/gitlab/vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.15/lib/action_dispatch/middleware/stack.rb:113:in `build'
/sync1/gitlab/vendor/bundle/ruby/2.0.0/gems/railties-3.2.15/lib/rails/engine.rb:475:in `app'
/sync1/gitlab/vendor/bundle/ruby/2.0.0/gems/railties-3.2.15/lib/rails/application/finisher.rb:31:in `block in <module:Finisher>'
/sync1/gitlab/vendor/bundle/ruby/2.0.0/gems/railties-3.2.15/lib/rails/initializable.rb:30:in `instance_exec'
/sync1/gitlab/vendor/bundle/ruby/2.0.0/gems/railties-3.2.15/lib/rails/initializable.rb:30:in `run'
/sync1/gitlab/vendor/bundle/ruby/2.0.0/gems/railties-3.2.15/lib/rails/initializable.rb:55:in `block in run_initializers'
/sync1/gitlab/vendor/bundle/ruby/2.0.0/gems/railties-3.2.15/lib/rails/initializable.rb:54:in `each'
/sync1/gitlab/vendor/bundle/ruby/2.0.0/gems/railties-3.2.15/lib/rails/initializable.rb:54:in `run_initializers'
/sync1/gitlab/vendor/bundle/ruby/2.0.0/gems/railties-3.2.15/lib/rails/application.rb:136:in `initialize!'
/sync1/gitlab/vendor/bundle/ruby/2.0.0/gems/railties-3.2.15/lib/rails/railtie/configurable.rb:30:in `method_missing'
/sync1/gitlab/config/environment.rb:5:in `<top (required)>'
config.ru:3:in `require'
config.ru:3:in `block in <main>'
/sync1/gitlab/vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/builder.rb:51:in `instance_eval'
/sync1/gitlab/vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/builder.rb:51:in `initialize'
config.ru:1:in `new'
config.ru:1:in `<main>'
/usr/local/lib64/ruby/gems/2.0.0/gems/passenger-4.0.23/helper-scripts/rack-preloader.rb:105:in `eval'
/usr/local/lib64/ruby/gems/2.0.0/gems/passenger-4.0.23/helper-scripts/rack-preloader.rb:105:in `preload_app'
/usr/local/lib64/ruby/gems/2.0.0/gems/passenger-4.0.23/helper-scripts/rack-preloader.rb:150:in `<module:App>'
/usr/local/lib64/ruby/gems/2.0.0/gems/passenger-4.0.23/helper-scripts/rack-preloader.rb:29:in `<module:PhusionPassenger>'
/usr/local/lib64/ruby/gems/2.0.0/gems/passenger-4.0.23/helper-scripts/rack-preloader.rb:28:in `<main>'
omniauth-pam 的文档指出它不需要任何配置参数。所以这个错误对我来说是无法解释的。