0

我是第一次将 facebook 登录集成到 ROR 应用程序,因为在初始化中创建omniauth.rb 文件后我正在使用以下教程 我尝试rails generate controller sessions new create failure在终端中运行这个()命令我得到一个错误:

omn​​iauth.rb 文件中的代码是:

Rails.application.config.middleware.use OmniAuth::Builder do
  provider :facebook, 123432432433, 1233443232342432432
end

T收到此错误:

omniauth-tutorial/config/initializers/omniauth.rb:2: syntax error, unexpected tIDENTIFIER, expecting kEND (SyntaxError)
    from /usr/lib/ruby/gems/1.8/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:234:in `load'
    from /usr/lib/ruby/gems/1.8/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:223:in `load_dependency'
    from /usr/lib/ruby/gems/1.8/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:640:in `new_constants_in'
    from /usr/lib/ruby/gems/1.8/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:223:in `load_dependency'
    from /usr/lib/ruby/gems/1.8/gems/activesupport-3.1.3/lib/active_support/dependencies.rb:234:in `load'
    from /usr/lib/ruby/gems/1.8/gems/railties-3.1.3/lib/rails/engine.rb:556
    from /usr/lib/ruby/gems/1.8/gems/railties-3.1.3/lib/rails/engine.rb:555:in `each'
    from /usr/lib/ruby/gems/1.8/gems/railties-3.1.3/lib/rails/engine.rb:555
    from /usr/lib/ruby/gems/1.8/gems/railties-3.1.3/lib/rails/initializable.rb:30:in `instance_exec'
    from /usr/lib/ruby/gems/1.8/gems/railties-3.1.3/lib/rails/initializable.rb:30:in `run'
    from /usr/lib/ruby/gems/1.8/gems/railties-3.1.3/lib/rails/initializable.rb:55:in `run_initializers'
    from /usr/lib/ruby/gems/1.8/gems/railties-3.1.3/lib/rails/initializable.rb:54:in `each'
    from /usr/lib/ruby/gems/1.8/gems/railties-3.1.3/lib/rails/initializable.rb:54:in `run_initializers'
    from /usr/lib/ruby/gems/1.8/gems/railties-3.1.3/lib/rails/application.rb:96:in `initialize!'
    from /usr/lib/ruby/gems/1.8/gems/railties-3.1.3/lib/rails/railtie/configurable.rb:30:in `send'
    from /usr/lib/ruby/gems/1.8/gems/railties-3.1.3/lib/rails/railtie/configurable.rb:30:in `method_missing'
    from /home/bilmailid17/appror/omniauth-tutorial/config/environment.rb:5
    from /usr/lib/ruby/gems/1.8/gems/railties-3.1.3/lib/rails/application.rb:83:in `require'
    from /usr/lib/ruby/gems/1.8/gems/railties-3.1.3/lib/rails/application.rb:83:in `require_environment!'
    from /usr/lib/ruby/gems/1.8/gems/railties-3.1.3/lib/rails/commands.rb:22
    from script/rails:6:in `require'
    from script/rails:6 
4

1 回答 1

1

尝试在您的 APP_ID 和 APP_SECRET 周围加上引号:

提供者:facebook,“123432432433”,“1233443232342432432”

于 2012-08-31T08:26:21.217 回答