Nokogiri not required when library is loaded.
To re-create:
-
Install
microsoft_graphgem withgem install microsoft_graph -
create a file with the following code:
# test.rb
MicrosoftGraph.new({
base_url: 'https://graph.microsoft.com/v1.0',
cached_metadata_file: File.join(MicrosoftGraph::CACHED_METADATA_DIRECTORY, 'metadata_v1.0.xml'),
}, &(->(r) { r.headers['Authorization'] = "Bearer #{token}" }))
- run this code with
ruby test.rb
Gem Version: microsoft_graph (0.1.3)
Solution
I think require 'nokogiri' is just required somewhere in the loading process? Would a PR be appreciated?
Nokogiri is required for the ADAL library which is used to obtain a token. If you are using an alternative auth library then you will not need it.
Nokogiri is used in the sdk. see https://github.com/microsoftgraph/msgraph-sdk-ruby/blob/master/lib/odata/service.rb#L248
Thanks for reporting this issue. That version of the SDK has been deprecated a number of years ago. We're now starting the work on a new generation of this SDK and you can learn all about it on the updated readme page.