Skip to content
This repository was archived by the owner on May 17, 2021. It is now read-only.

uninitialized constant OmniAuth (NameError) #31

Open
leinad1 opened this issue Sep 12, 2017 · 12 comments
Open

uninitialized constant OmniAuth (NameError) #31

leinad1 opened this issue Sep 12, 2017 · 12 comments

Comments

@leinad1
Copy link

leinad1 commented Sep 12, 2017

trying to configure without success...
error.log is stating:
Message from application: uninitialized constant OmniAuth (NameError)
/usr/share/redmine/lib/plugins/redmine_omniauth_saml-master/lib/redmine_omniauth_saml.rb:119:in configure_omniauth_saml_middleware' /usr/share/redmine/lib/plugins/redmine_omniauth_saml-master/lib/redmine_omniauth_saml.rb:110:in validate_configuration!'
/usr/share/redmine/lib/plugins/redmine_omniauth_saml-master/lib/redmine_omniauth_saml.rb:60:in `configure'
Any ideas?

@chrodriguez
Copy link
Owner

This problem is because required gem in not loaded. Did you run bundle and restart your service?

@leinad1
Copy link
Author

leinad1 commented Sep 12, 2017

I ran bundle in redmine and plugin dir and restarted Apache.

@chrodriguez
Copy link
Owner

Can you please paste the bundle output?

@leinad1
Copy link
Author

leinad1 commented Sep 12, 2017

Using bundler 1.16.0.pre.2
Using hashie 3.5.6
Using systemu 2.6.5
Using macaddr 1.7.1
Using mini_portile2 2.2.0
Using nokogiri 1.8.0
Using rack 1.6.8
Using omniauth 1.2.2
Using uuid 2.3.8
Using ruby-saml 0.9.2
Using omniauth-saml-cespi 1.3.1

@chrodriguez
Copy link
Owner

Are you sure ruby process serving redmine has been restarted? Because gems are supposed to be downloaded, but the instance runing says it can't find OmniAuth class provided by one of the used gems

@leinad1
Copy link
Author

leinad1 commented Sep 12, 2017

just rebooted the system, but no change

@chrodriguez
Copy link
Owner

Which redmine version are you using?

@leinad1
Copy link
Author

leinad1 commented Sep 12, 2017

3.2.1-2

@leinad1
Copy link
Author

leinad1 commented Sep 12, 2017

during installation I had some issues getting nokogiri 1.6.2.2 installed. Finally, I made it by installing 1.8.0.

@chrodriguez
Copy link
Owner

I can't reproduce your problem. I've followed this steps. Asuming you have installed ruby version 2.3.x or newer with bundler gem installed:

Download redmine & plugin

git clone http://github.com/redmine/redmine.git
cd redmine
git checkout 3.2-stable
git clone http://github.com/chrodriguez/redmine_omniauth_saml.git plugins/redmine_omniauth_saml

Edit database.yml

Edit its contents with the following test data:

production:
  adapter: sqlite3
  database: db/redmine.sqlite3

Copy saml initializer

Copy sample initializer file provided with this plugin:

cp plugins/redmine_omniauth_saml/sample-saml-initializers.rb config/initializers/

Run bundler and rake tasks

Install required gems and run some rake tasks related with db migrations, redmien secret token and load sample data

bundle
RAILS_ENV=production rake db:drop db:create db:migrate db:seed generate_secret_token
RAILS_ENV=production rails server

Test

Access with a browser to http://localhost:3000/login

I've tested as described above and it's working. Something seems to be misconfigured. I think Apache might be configured using passenger, and may be it's not using the same user profile as the user you run bundle with. So try runing bundler with the same user Apache Passenger (if is your case) is running

@leinad1
Copy link
Author

leinad1 commented Sep 12, 2017

@leinad1
Copy link
Author

leinad1 commented Sep 12, 2017

I removed redmine and installed again, following your procedure and it worked!
Tomorrow, I will continue to work with SSO SAML setup...
Thanks, for your very very quick responses!!!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants