ruby on rails - How to get rid of uninitialized constant Omniauth (NameError)? -
i have fresh rails-composer omniauth application. when running tests rspec gives error:
$ rspec /home/grzegorz/programing/integra/spec/support/helpers.rb:5:in `block in <top (required)>': uninitialized constant omniauth (nameerror) /home/grzegorz/.rvm/gems/ruby-2.2.2@integra/gems/rspec-core-3.3.1/lib/rspec/core.rb:97:in `configure' /home/grzegorz/programing/integra/spec/support/helpers.rb:4:in `<top (required)>' /home/grzegorz/programing/integra/spec/rails_helper.rb:23:in `block in <top (required)>' /home/grzegorz/programing/integra/spec/rails_helper.rb:23:in `each' /home/grzegorz/programing/integra/spec/rails_helper.rb:23:in `<top (required)>' /home/grzegorz/.rvm/gems/ruby-2.2.2@integra/gems/rspec-core-3.3.1/lib/rspec/core/configuration.rb:1280:in `require' /home/grzegorz/.rvm/gems/ruby-2.2.2@integra/gems/rspec-core-3.3.1/lib/rspec/core/configuration.rb:1280:in `block in requires=' /home/grzegorz/.rvm/gems/ruby-2.2.2@integra/gems/rspec-core-3.3.1/lib/rspec/core/configuration.rb:1280:in `each' /home/grzegorz/.rvm/gems/ruby-2.2.2@integra/gems/rspec-core-3.3.1/lib/rspec/core/configuration.rb:1280:in `requires=' /home/grzegorz/.rvm/gems/ruby-2.2.2@integra/gems/rspec-core-3.3.1/lib/rspec/core/configuration_options.rb:109:in `block in process_options_into' /home/grzegorz/.rvm/gems/ruby-2.2.2@integra/gems/rspec-core-3.3.1/lib/rspec/core/configuration_options.rb:108:in `each' /home/grzegorz/.rvm/gems/ruby-2.2.2@integra/gems/rspec-core-3.3.1/lib/rspec/core/configuration_options.rb:108:in `process_options_into' /home/grzegorz/.rvm/gems/ruby-2.2.2@integra/gems/rspec-core-3.3.1/lib/rspec/core/configuration_options.rb:21:in `configure' /home/grzegorz/.rvm/gems/ruby-2.2.2@integra/gems/rspec-core-3.3.1/lib/rspec/core/runner.rb:101:in `setup' /home/grzegorz/.rvm/gems/ruby-2.2.2@integra/gems/rspec-core-3.3.1/lib/rspec/core/runner.rb:88:in `run' /home/grzegorz/.rvm/gems/ruby-2.2.2@integra/gems/rspec-core-3.3.1/lib/rspec/core/runner.rb:73:in `run' /home/grzegorz/.rvm/gems/ruby-2.2.2@integra/gems/rspec-core-3.3.1/lib/rspec/core/runner.rb:41:in `invoke' /home/grzegorz/.rvm/gems/ruby-2.2.2@integra/gems/rspec-core-3.3.1/exe/rspec:4:in `<top (required)>' /home/grzegorz/.rvm/gems/ruby-2.2.2@integra/bin/rspec:23:in `load' /home/grzegorz/.rvm/gems/ruby-2.2.2@integra/bin/rspec:23:in `<main>' /home/grzegorz/.rvm/gems/ruby-2.2.2@integra/bin/ruby_executable_hooks:15:in `eval' /home/grzegorz/.rvm/gems/ruby-2.2.2@integra/bin/ruby_executable_hooks:15:in `<main>'
it gives me trouble debbug.
edit. gem file has those:
gem 'omniauth' gem 'omniauth-facebook'
it fresh app generated rails-composer, no custom code.
you should add require_relative 'helpers/omniauth'
@ beginning of spec/support/helpers.rb
- works me.
Comments
Post a Comment