How to load configuration for Cequel Gem for Ruby without Rails

You can use this method:

Cequel::Record.establish_connection

Example:


# Load config from yaml:
config = YAML.load_file('config/cequel.yml')['development']

# Now you can initialize connection:
Cequel.Record.establish_connection(
  host: config[:host],
  port: config[:port],
  keyspace: config[:keyspace]
)

Добавить комментарий

Ваш e-mail не будет опубликован. Обязательные поля помечены *