Genius/omniauth-genius

Not working with Omniauth 1.2.2?

Closed this issue · 5 comments

Trying to use the omniauth-genius strategy with devise in rails 4 app keeps resulting in 'strategy not found' error.

If I add to devise.rb the following:

config.omniauth :genius, ENV['GENIUS_CLIENT_ID'], ENV['GENIUS_CLIENT_SECRET']

I get the following error:

"Could not find a strategy with name Genius'. Please ensure it is required or explicitly set it using the :strategy_class option. (Devise::OmniAuth::StrategyNotFound)"`

Or, even without devise, if I just try to add 'omniauth-genius' to a vanilla rails app and add to config/initializers/omniauth.rb the following:

Rails.application.config.middleware.use OmniAuth::Builder do
  provider :genius, ENV['GENIUS_CLIENT_ID'], ENV['GENIUS_CLIENT_SECRET']
end

I get the following error:

"gems/omniauth-1.2.2/lib/omniauth/builder.rb:50:in `rescue in provider': Could not find matching strategy for :genius. You may need to install an additional gem (such as omniauth-genius). (LoadError)"

Not sure why it can't find it since I have added both 'omniauth' and 'omniauth-genius' to my gemfile and have run bundle install.

Odd - we're doing the same in a sample app and it's working ok on our end.
What does your Gemfile look like regarding 'omniatuh-genius'?

source 'https://rubygems.org'


# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.2'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.1.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby

# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0', group: :doc

gem 'figaro'

gem 'omniauth'
gem 'omniauth-genius'

# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'

# Use Unicorn as the app server
# gem 'unicorn'

# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development

group :development, :test do
  # Call 'byebug' anywhere in the code to stop execution and get a debugger console
  gem 'byebug'

  # Access an IRB console on exception pages or by using <%= console %> in views
  gem 'web-console', '~> 2.0'

  # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
  gem 'spring'
end

Thanks for the details, a bundle update omniauth-genius should get you going
I fixed an issue with the gemspec

Thanks again!

Awesome! Thanks, John!

My pleasure! :)