2

gemfile에 oauth2와 authlogic-oauth2를 포함 시켰습니다. 사용하려고하고 서버를 시작하려고합니다. 시작되지 않고 오류가 발생합니다 :authlogic-oauth2를 사용하면 서버가 시작되지 않습니다.

/Library/Ruby/Gems/1.8/gems/railties-3.0.3/lib/rails.rb:44:in `configuration': undefined method `config' for nil:NilClass (NoMethodError) 
     from /Library/Ruby/Gems/1.8/gems/authlogic_oauth2-1.1.2/lib/authlogic_oauth2.rb:14 
     from /Library/Ruby/Gems/1.8/gems/bundler-1.0.7/lib/bundler/runtime.rb:64:in `require' 
     from /Library/Ruby/Gems/1.8/gems/bundler-1.0.7/lib/bundler/runtime.rb:64:in `require' 
     from /Library/Ruby/Gems/1.8/gems/bundler-1.0.7/lib/bundler/runtime.rb:62:in `each' 
     from /Library/Ruby/Gems/1.8/gems/bundler-1.0.7/lib/bundler/runtime.rb:62:in `require' 
     from /Library/Ruby/Gems/1.8/gems/bundler-1.0.7/lib/bundler/runtime.rb:51:in `each' 
     from /Library/Ruby/Gems/1.8/gems/bundler-1.0.7/lib/bundler/runtime.rb:51:in `require' 
     from /Library/Ruby/Gems/1.8/gems/bundler-1.0.7/lib/bundler.rb:112:in `require' 
     from /Users/arkidmitra/Documents/qorm_bzar/buyzaar/config/application.rb:7 
     from /Library/Ruby/Gems/1.8/gems/railties-3.0.3/lib/rails/commands.rb:28:in `require' 
     from /Library/Ruby/Gems/1.8/gems/railties-3.0.3/lib/rails/commands.rb:28 
     from /Library/Ruby/Gems/1.8/gems/railties-3.0.3/lib/rails/commands.rb:27:in `tap' 
     from /Library/Ruby/Gems/1.8/gems/railties-3.0.3/lib/rails/commands.rb:27 
     from script/rails:6:in `require' 
     from script/rails:6 

나는 레일 3.0.3과 루비 1.8.7을 사용하고 있습니다. 또한 서버를 추가 할 때까지 서버가 계속 시작되는 것처럼 보입니다.

gem "authlogic-oauth2" 

을 Gemfile에 추가하는 것으로 보입니다.

+0

레일 구성 파일을 표시하십시오. – wizztjh

+0

레일 구성 파일은 어떤 파일을 의미합니까? 또한 Gemfile에 "authlogic-oauth2"라는 줄 보석을 추가 할 때까지 계속해서 잘 돌아가는 것 같습니다. 보고 싶은 파일이 무엇인지 말해줘. –

답변

1

authlogic-oauth2는 Andrew에게 더 이상주의를 기울이지 않습니다. 업데이트 된 보석이 당신을 위해 문제를 해결 https://github.com/robdimarco/authlogic_oauth2

Here the authlogic_oauth2.rb had been changed. 
require File.dirname(__FILE__) + "/authlogic_oauth2/version" 
require File.dirname(__FILE__) + "/authlogic_oauth2/oauth2_process" 
require File.dirname(__FILE__) + "/authlogic_oauth2/acts_as_authentic" 
require File.dirname(__FILE__) + "/authlogic_oauth2/session" 
require File.dirname(__FILE__) + "/authlogic_oauth2/helper" 
require File.dirname(__FILE__) + "/oauth2_callback_filter" 

ActiveRecord::Base.send(:include, AuthlogicOauth2::ActsAsAuthentic) 
Authlogic::Session::Base.send(:include, AuthlogicOauth2::Session) 
ActionController::Base.helper AuthlogicOauth2::Helper 

# Throw callback rack app into the middleware stack 
if defined?(ActionController::Metal) 
    module AuthlogicOAuth2 
    class Railtie < Rails::Railtie 
     initializer :load_oauth2_callback_filter do |app| 
     app.config.middleware.use(Oauth2CallbackFilter) # Rails >= 3.0 
     end 
    end 
    end 
else 
    ActionController::Dispatcher.middleware.use(Oauth2CallbackFilter) # Rails < 3.0 
end 

희망을 시도합니다.

관련 문제