Cequel Gem for Ruby without Rails. How to load configuration?

183 Views Asked by At

I am attempting to setup Cequel Gem for use with my existing Ruby app. From what I can tell, the Cequel gem requires the railtie to configure it to use the configuration (as my cequel.yml is in the same place as it is in Rails). But, it seems the configuration is not being loaded.

How is this supposed to be done in a non-Rails environment?

1

There are 1 best solutions below

0
On

In my case works like this:

conn = {
  host: '127.0.0.1', 
  port: 9042, 
  username: 'login',
  password: 'pass',
  keyspace: 'slyplan'
}

Cequel::Record.establish_connection(conn)

In your case load connection from YAML file:

conn = YAML.load_file('path/to/your/cequel.yml')