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!

Splunk APM: New Product Features + Community Office Hours Recap!

Howdy Splunk Community! Over the past few months, we’ve had a lot going on in the world of Splunk Application ...

Index This | Forward, I’m heavy; backward, I’m not. What am I?

April 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

A Guide To Cloud Migration Success

As enterprises’ rapid expansion to the cloud continues, IT leaders are continuously looking for ways to focus ...