Plugin installation issue with omniauth-ldap

(Steven Arnott) #1

Trying to install the plugin from

Getting the following from the bootstrap:

I, [2015-06-16T16:19:03.281356 #38]  INFO -- : > cd /var/www/discourse && su discourse -c 'bundle exec rake db:migrate'
rake aborted!
Gem::LoadError: Could not find 'net-ldap' (~> 0.3.1) among 172 total gem(s)
Checked in 'GEM_PATH=/var/www/discourse/vendor/bundle/ruby/2.0.0', execute `gem env` for more information
/var/www/discourse/lib/plugin/instance.rb:292:in `gem'
/var/www/discourse/plugins/discourse-active_directory/plugin.rb:6:in `activate!'
/var/www/discourse/lib/plugin/instance.rb:228:in `instance_eval'
/var/www/discourse/lib/plugin/instance.rb:228:in `activate!'
/var/www/discourse/lib/discourse.rb:103:in `block in activate_plugins!'
/var/www/discourse/lib/discourse.rb:100:in `each'
/var/www/discourse/lib/discourse.rb:100:in `activate_plugins!'
/var/www/discourse/config/application.rb:166:in `<class:Application>'
/var/www/discourse/config/application.rb:19:in `<module:Discourse>'
/var/www/discourse/config/application.rb:18:in `<top (required)>'
/var/www/discourse/Rakefile:5:in `require'
/var/www/discourse/Rakefile:5:in `<top (required)>'
(See full trace by running task with --trace)
I, [2015-06-16T16:19:12.408834 #38]  INFO -- : gem install omniauth-ldap -v 1.0.4 -i /var/www/discourse/plugins/discourse-active_directory/gems/2.0.0 --no-document --ignore-dependencies
Successfully installed omniauth-ldap-1.0.4
1 gem installed

Any suggestions as how to fix this?

(Sam Saffron) #2

You need to explicitly include all dependencies, my guess is that the plugin is not doing that.

(Steven Arnott) #3

I tried explicitly adding omniauth_ldap to the discourse_base image, which then installed the net-ldap dependancy.
I’m rolling my own as I need to alter the UID of the discourse user but that did not help.

Are you suggesting there is some fix to the omniauth-ldap gem needed?

(Sam Saffron) #4

Nope the plugin.rb file needs to explicitly call out every dependency

(Kirolous Frouk) #5

Is there an example on how to call dependencies,and is there an example of being able to add my own custom gem ?

(Sam Saffron) #6

there are plenty examples read through our plugins the gist is adding

gem 'name', 'version' to plugin.rb, see Brand new plugin interface

(Kirolous Frouk) #7

So I have forked the plugin and added all the dependencies but there is one dependency (pyu-ruby-sasl -v that omniauth-ldap requires , now pyu-ruby-sasl version is completely yanked and when i build it errors out because it cannot find the gem. I have been trying to add a custom gem but I have been failing .How would I go about adding a custom gem ?

(Kane York) #9

You should change the pyu-ruby-sasl version to

(Kirolous Frouk) #10

Okay so I have done all the modifications needed ,now when trying to load pyu-ruby-sasl i get the error “LoadError: cannot load such file – kiro-ruby-sasl”.How do I get a trace of whats happening ?.BTW thank you ! :slight_smile:

(Kirolous Frouk) #11

I used kiro-ruby-sasl to modify the gem code but i got the exact same error for pyu-ruby-sasl as well

(Wimtie) #12

I am running into the same issue, where it seems that whatever gem I add to the plugin will always result in this error:

/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.10/lib/active_support/dependencies.rb:247:in 'require': cannot load such file -- (LoadError)

Does anyone have an idea what’s up here?

(Jeff Atwood) #13

May I ask a more pertinent question, what is up with your face, man?!

(Wimtie) #14

Being an IT professional happened :scream:

(Wimtie) #16

So there’s no one around willing to help me with my ruby gem/discourse plugin combination woes? I’m not exactly an experienced Ruby dev, so I’ve no idea what’s going on.

(Jeff Atwood) #17

Your face man, we can’t stop looking at your faaaaaace

(Gerhard Schlager) #18

Did you try @Kirolous_Frouk’s fork?

(Wimtie) #19

That plugin gives me the same error:

/var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.10/lib/active_support/dependencies.rb:247:in `require': cannot load such file -- pyu-ruby-sasl (LoadError)
from /var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.10/lib/active_support/dependencies.rb:247:in `block in require'
from /var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.10/lib/active_support/dependencies.rb:232:in `load_dependency'
from /var/www/discourse/vendor/bundle/ruby/2.0.0/gems/activesupport-4.1.10/lib/active_support/dependencies.rb:247:in `require'
from /var/www/discourse/lib/plugin/instance.rb:294:in `gem'
from /var/www/discourse/plugins/active_directory/plugin.rb:7:in `activate!'
from /var/www/discourse/lib/plugin/instance.rb:228:in `instance_eval'
from /var/www/discourse/lib/plugin/instance.rb:228:in `activate!'
from /var/www/discourse/lib/discourse.rb:109:in `block in activate_plugins!'
from /var/www/discourse/lib/discourse.rb:106:in `each'
from /var/www/discourse/lib/discourse.rb:106:in `activate_plugins!'
from /var/www/discourse/config/application.rb:166:in `<class:Application>'
from /var/www/discourse/config/application.rb:19:in `<module:Discourse>'
from /var/www/discourse/config/application.rb:18:in `<top (required)>'
from /var/www/discourse/config/environment.rb:2:in `require'
from /var/www/discourse/config/environment.rb:2:in `<top (required)>'
from `require'
from `block in <main>'
from /var/www/discourse/vendor/bundle/ruby/2.0.0/gems/rack-1.5.5/lib/rack/builder.rb:55:in `instance_eval'
from /var/www/discourse/vendor/bundle/ruby/2.0.0/gems/rack-1.5.5/lib/rack/builder.rb:55:in `initialize'
from `new'
from `<main>'
from /var/www/discourse/vendor/bundle/ruby/2.0.0/gems/unicorn-4.8.3/lib/unicorn.rb:48:in `eval'
from /var/www/discourse/vendor/bundle/ruby/2.0.0/gems/unicorn-4.8.3/lib/unicorn.rb:48:in `block in builder'
from /var/www/discourse/vendor/bundle/ruby/2.0.0/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:764:in `call'
from /var/www/discourse/vendor/bundle/ruby/2.0.0/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:764:in `build_app!'
from /var/www/discourse/vendor/bundle/ruby/2.0.0/gems/unicorn-4.8.3/lib/unicorn/http_server.rb:137:in `start'
from /var/www/discourse/vendor/bundle/ruby/2.0.0/gems/unicorn-4.8.3/bin/unicorn:126:in `<top (required)>'
from /var/www/discourse/vendor/bundle/ruby/2.0.0/bin/unicorn:23:in `load'
from /var/www/discourse/vendor/bundle/ruby/2.0.0/bin/unicorn:23:in `<main>'

(Lennart Goedhart) #20

Yeah, for some reason including pyu-ruby-sasl in the plugin breaks the world :frowning:

If I set up a development Vagrant sandbox, and add “gem ‘omniauth-ldap’” to the Gemfile, “bundle install” downloads omniauth-ldap and all its dependencies just fine. If I uninstall the bundles and include the same “gem ‘BLAH’, ‘version’” for omniauth-ldap and all of the same dependencies that “bundle install” just had no problem installing, I get the above error, too.
I created my own fork of discourse_active-directory with some extra config features and fixes to work on the current version of discourse, but I can’t for the life of me get it to deploy to a production environment.

(Sam Saffron) #21

If you want to maintain it long term feel free to create a plugin topic, but contact existing author first to see if effort can be merged

(Lennart Goedhart) #22

I’m happy to merge it. At the moment I’m just trying to work out what these gem issues are. Do you have any pointers, @sam ?