Splunk Dev

Ruby sdk can not connect

bcordonnier
Engager

Hi,

I am new ruby and I am trying to get your example connect code to work. I just copy/pasted the code from here and changed my login info, but when I run I get this error, any ideas what could be causing it? Thanks in advance:

C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/splunk-sdk-ruby-0.8.0/lib/splunk-sdk-ruby/context.rb:401:in request_by_url': uninitialized constant
Splunk::Context::OpenSSL (NameError)
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/splunk-sdk-ruby-0.8.0/lib/splunk-sdk-ruby/context.rb:314:in
request'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/splunk-sdk-ruby-0.8.0/lib/splunk-sdk-ruby/context.rb:196:in login'
from C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/splunk-sdk-ruby-0.8.0/lib/splunk-sdk-ruby/service.rb:82:in
connect'
from two.rb:2:in `

'

Tags (3)
1 Solution

fross_splunk
Splunk Employee
Splunk Employee

The first problem is that you're using Ruby 2.0. There were sizable changes to the language from 1.9 to 2.0, and most of the community is still on 1.9, so we haven't ported the SDK to 2.0 yet.

If you're using the Ruby installer for Windows from rubyinstaller.org, then you want the previous version of it that provides Ruby 1.9.3. In our test environments, the SDK runs flawlessly in the Ruby installer's 1.9.3 version.

View solution in original post

fross_splunk
Splunk Employee
Splunk Employee

The first problem is that you're using Ruby 2.0. There were sizable changes to the language from 1.9 to 2.0, and most of the community is still on 1.9, so we haven't ported the SDK to 2.0 yet.

If you're using the Ruby installer for Windows from rubyinstaller.org, then you want the previous version of it that provides Ruby 1.9.3. In our test environments, the SDK runs flawlessly in the Ruby installer's 1.9.3 version.

e7sal
New Member

When do think there will be support for ruby 2.0.0?

0 Karma

bcordonnier
Engager

That did the trick, thanks!

0 Karma
Get Updates on the Splunk Community!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...