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!

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...