I'm trying to set up omniauth with the api.

I created a file in config/initializers/omniauth.rb:

Rails.application.config.middleware.use OmniAuth::Builder do
    provider :fitbit, b4aaad9b1 , 88bd74511f
    #NOT THE ACTUAL KEYS - I deleted middle numbers to preserve formatting
end

when I run:

rails s

I receive the error

gems/ruby-1.9.3-p448@rails3tutorial2ndEd/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:245:in `load': config/initializers/omniauth.rb:3: syntax error, unexpected tIDENTIFIER, expecting keyword_end (SyntaxError)

Any ideas how to fit this. I am very new to and :

thanks

有帮助吗?

解决方案

Correct way to pass a into a method, or even to use it at all, is to close it to single or double quotes. See it on your example:

Rails.application.config.middleware.use OmniAuth::Builder do
   provider :fitbit, 'b4aaad9b1', '88bd74511f'
end
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top