chrodriguez / redmine_omniauth_saml

Plugins that adds SAML authentication support for "Redmine"
GNU General Public License v2.0
38 stars 57 forks source link

uninitialized constant OmniAuth (NameError) #31

Open leinad1 opened 7 years ago

leinad1 commented 7 years ago

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:invalidate_configuration!' /usr/share/redmine/lib/plugins/redmine_omniauth_saml-master/lib/redmine_omniauth_saml.rb:60:in `configure' Any ideas?

chrodriguez commented 7 years ago

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

leinad1 commented 7 years ago

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

chrodriguez commented 7 years ago

Can you please paste the bundle output?

leinad1 commented 7 years ago

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 commented 7 years ago

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 commented 7 years ago

just rebooted the system, but no change

chrodriguez commented 7 years ago

Which redmine version are you using?

leinad1 commented 7 years ago

3.2.1-2

leinad1 commented 7 years ago

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

chrodriguez commented 7 years ago

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 commented 7 years ago

I followed this procedure: http://www.redmine.org/projects/redmine/wiki/HowTo_Install_Redmine_on_Ubuntu_step_by_step

leinad1 commented 7 years ago

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!!!