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!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...