Incompatible library version when loading the Cassandra

43 views
Skip to first unread message

Thanh Nguyen

unread,
Mar 2, 2017, 4:14:52 AM3/2/17
to DataStax Ruby Driver for Apache Cassandra User Mailing List
hello all, 

I got the issue show that "incompatible library version - /var/lib/jenkins/.gem/gems/cassandra-driver-3.1.0/lib/cassandra_murmur3.so (LoadError)", When I try to load the Cassandra from my ruby code as bellow: 

This is my ruby code: 

require 'cassandra'
require 'pry'

class CassandraConnect

  def initialize(keyspace = 'reconciliation')
    cluster = Cassandra.cluster(
        username: username,
        password: password,
        hosts: ['cassandra_hosts']
    )
    @session  = cluster.connect(keyspace)
  end

  def execute(query, options = {})
    @session.execute(query, options)
  end

  def close_connection
    @session.close()
  end
end

This is the error:

incompatible library version - /var/lib/jenkins/.gem/gems/cassandra-driver-3.1.0/lib/cassandra_murmur3.so (LoadError)
08:53:16 /var/lib/jenkins/.gem/gems/cassandra-driver-3.1.0/lib/cassandra.rb:826:in `require'
08:53:16 /var/lib/jenkins/.gem/gems/cassandra-driver-3.1.0/lib/cassandra.rb:826:in `<top (required)>'
08:53:16 /var/lib/jenkins/workspace/jobs/lib/models/cassandra.rb:1:in `require'
08:53:16 /var/lib/jenkins/workspace/jobs/lib/models/cassandra.rb:1:in `<top (required)>'

I tried to uninstall the gem, and re-install but that could not help. Can you please help me to figure out the problem with my code?

Bulat Shakirzyanov

unread,
Mar 2, 2017, 9:57:32 AM3/2/17
to ruby-dri...@lists.datastax.com
Hi Thanh,

You're likely installing the gem with one version of ruby and trying to use it with another.
This could happen if you installed and cached it on one machine for example, and then attempted to use it on another one.
To know exactly what's happening I'd need to know more about how you're installing and running your ruby app, including the ruby versions involved in those steps.

Hopefully this gives you enough info to start digging.

--
You received this message because you are subscribed to the Google Groups "DataStax Ruby Driver for Apache Cassandra User Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ruby-driver-user+unsubscribe@lists.datastax.com.



--
Cheers,
Bulat Shakirzyanov | @avalanche123

Thanh Nguyen

unread,
Mar 16, 2017, 7:03:57 AM3/16/17
to ruby-dri...@lists.datastax.com
hi @Bulat, 

Your reply is exactly what I got, and the issue was fixed after I use RVM to manage the ruby versions. 

Thank you very much for your reply

Cheer!
-- 
Thanh

Bulat Shakirzyanov

unread,
Mar 16, 2017, 9:51:43 AM3/16/17
to ruby-dri...@lists.datastax.com
Great, glad to hear you've figured it out!

On Thu, Mar 16, 2017 at 7:03 AM, Thanh Nguyen <thanh...@gmail.com> wrote:
hi @Bulat, 

Your reply is exactly what I got, and the issue was fixed after I use RVM to manage the ruby versions. 

Thank you very much for your reply

Reply all
Reply to author
Forward
0 new messages