Closed roccia closed 8 years ago
If you use rails >= 4.1
here's solution for you ;)
create file omniauth.rb in /conifg/initializers/
Rails.application.config.middleware.use OmniAuth::Builder do
provider :steam, Rails.application.secrets.STEAM_WEB_API_KEY
end
Get your api key from http://steamcommunity.com/dev/apikey and add line like this to your file /config/secrets.yml in each env.
STEAM_WEB_API_KEY: HERE_YOUR_API_KEY
Very nice @h4b00! I will try to make this more clear on the README
HI there, I'm following this tutorial : https://github.com/bodrovis/Sitepoint-source/tree/master/Dota_on_Rails when I filled out the steam account info , this error came out:
undefined method `[]' for nil:NilClass Extracted source (around line #39): 37
38 def player 39 @player ||= raw_info["response"]["players"].first 40 end 41 42 def steam_id
Rails.root: /home/ubuntu/workspace
Application Trace | Framework Trace | Full Trace omniauth-steam (1.0.3) lib/omniauth/strategies/steam.rb:39:in
player' omniauth-steam (1.0.3) lib/omniauth/strategies/steam.rb:17:in
block in class:Steam' omniauth (1.2.2) lib/omniauth/strategy.rb:105:ininstance_eval' omniauth (1.2.2) lib/omniauth/strategy.rb:105:in
block in compile_stack' omniauth (1.2.2) lib/omniauth/strategy.rb:104:ineach' omniauth (1.2.2) lib/omniauth/strategy.rb:104:in
inject' omniauth (1.2.2) lib/omniauth/strategy.rb:104:incompile_stack' (eval):7:in
info_stack' omniauth (1.2.2) lib/omniauth/strategy.rb:321:ininfo' omniauth (1.2.2) lib/omniauth/strategy.rb:334:in
auth_hash' omniauth (1.2.2) lib/omniauth/strategy.rb:361:incallback_phase' omniauth-openid (1.0.1) lib/omniauth/strategies/open_id.rb:81:in
callback_phase' omniauth (1.2.2) lib/omniauth/strategy.rb:227:incallback_call' omniauth (1.2.2) lib/omniauth/strategy.rb:184:in
call!' omniauth (1.2.2) lib/omniauth/strategy.rb:164:incall' omniauth (1.2.2) lib/omniauth/builder.rb:59:in
call' rack (1.6.1) lib/rack/etag.rb:24:incall' rack (1.6.1) lib/rack/conditionalget.rb:25:in
call' rack (1.6.1) lib/rack/head.rb:13:incall' actionpack (4.2.1) lib/action_dispatch/middleware/params_parser.rb:27:in
call' actionpack (4.2.1) lib/action_dispatch/middleware/flash.rb:260:incall' rack (1.6.1) lib/rack/session/abstract/id.rb:225:in
context' rack (1.6.1) lib/rack/session/abstract/id.rb:220:incall' actionpack (4.2.1) lib/action_dispatch/middleware/cookies.rb:560:in
call' activerecord (4.2.1) lib/active_record/query_cache.rb:36:incall' activerecord (4.2.1) lib/active_record/connection_adapters/abstract/connection_pool.rb:649:in
call' activerecord (4.2.1) lib/active_record/migration.rb:378:incall' actionpack (4.2.1) lib/action_dispatch/middleware/callbacks.rb:29:in
block in call' activesupport (4.2.1) lib/active_support/callbacks.rb:88:incall' activesupport (4.2.1) lib/active_support/callbacks.rb:88:in
_run_callbacks' activesupport (4.2.1) lib/active_support/callbacks.rb:776:in_run_call_callbacks' activesupport (4.2.1) lib/active_support/callbacks.rb:81:in
run_callbacks' actionpack (4.2.1) lib/action_dispatch/middleware/callbacks.rb:27:incall' actionpack (4.2.1) lib/action_dispatch/middleware/reloader.rb:73:in
call' actionpack (4.2.1) lib/action_dispatch/middleware/remote_ip.rb:78:incall' better_errors (2.1.1) lib/better_errors/middleware.rb:59:in
call' actionpack (4.2.1) lib/action_dispatch/middleware/debug_exceptions.rb:17:incall' web-console (2.1.2) lib/web_console/middleware.rb:29:in
call' actionpack (4.2.1) lib/action_dispatch/middleware/show_exceptions.rb:30:incall' railties (4.2.1) lib/rails/rack/logger.rb:38:in
call_app' railties (4.2.1) lib/rails/rack/logger.rb:20:inblock in call' activesupport (4.2.1) lib/active_support/tagged_logging.rb:68:in
block in tagged' activesupport (4.2.1) lib/active_support/tagged_logging.rb:26:intagged' activesupport (4.2.1) lib/active_support/tagged_logging.rb:68:in
tagged' railties (4.2.1) lib/rails/rack/logger.rb:20:incall' actionpack (4.2.1) lib/action_dispatch/middleware/request_id.rb:21:in
call' rack (1.6.1) lib/rack/methodoverride.rb:22:incall' rack (1.6.1) lib/rack/runtime.rb:18:in
call' activesupport (4.2.1) lib/active_support/cache/strategy/local_cache_middleware.rb:28:incall' rack (1.6.1) lib/rack/lock.rb:17:in
call' actionpack (4.2.1) lib/action_dispatch/middleware/static.rb:113:incall' rack (1.6.1) lib/rack/sendfile.rb:113:in
call' railties (4.2.1) lib/rails/engine.rb:518:incall' railties (4.2.1) lib/rails/application.rb:164:in
call' rack (1.6.1) lib/rack/lock.rb:17:incall' rack (1.6.1) lib/rack/content_length.rb:15:in
call' rack (1.6.1) lib/rack/handler/webrick.rb:89:inservice' /usr/local/rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/webrick/httpserver.rb:138:in
service' /usr/local/rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/webrick/httpserver.rb:94:inrun' /usr/local/rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/webrick/server.rb:294:in
block in start_thread'There is a exactly same issues post here : https://github.com/reu/omniauth-steam/issues/10 but I tried their solution, still did not figure out how to make it right. Wish someone can help me! Thank you!