Я пытаюсь установить соединение Active Record с моим сценарием ruby и продолжаю получать следующую ошибку:
Traceback (most recent call last):
10: from ./main.rb:2:in `<main>'
9: from /home/daveomcd/.rvm/rubies/ruby-2.5.1/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
8: from /home/daveomcd/.rvm/rubies/ruby-2.5.1/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require'
7: from /mnt/c/Users/mcdonaldd/Documents/Ruby Projects/nfl_ngs/config/initializers/initializer.rb:17:in `<top (required)>'
6: from /home/daveomcd/.rvm/gems/ruby-2.5.1/gems/activerecord-5.2.0/lib/active_record/connection_handling.rb:60:in `establish_connection'
5: from /home/daveomcd/.rvm/gems/ruby-2.5.1/gems/activerecord-5.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:950:in `establish_connection'
4: from /home/daveomcd/.rvm/gems/ruby-2.5.1/gems/activerecord-5.2.0/lib/active_record/connection_adapters/connection_specification.rb:190:in `spec'
3: from /home/daveomcd/.rvm/gems/ruby-2.5.1/gems/activerecord-5.2.0/lib/active_record/connection_adapters/connection_specification.rb:203:in `rescue in spec'
2: from /home/daveomcd/.rvm/gems/ruby-2.5.1/gems/activerecord-5.2.0/lib/active_record/connection_adapters/connection_specification.rb:203:in `raise'
1: from /home/daveomcd/.rvm/gems/ruby-2.5.1/gems/activerecord-5.2.0/lib/active_record/connection_adapters/connection_specification.rb:203:in `exception'
/home/daveomcd/.rvm/rubies/ruby-2.5.1/lib/ruby/2.5.0/rubygems/errors.rb:84:in `initialize': wrong number of arguments (given 1, expected 2) (ArgumentError)
Мои файлы для подключения перечислены ниже, я не уверен, что я 'Я делаю неправильно.
require 'active_record'
require 'tiny_tds'
require 'rubygems'
require 'json'
require 'pp'
require 'yaml'
require 'base64'
require 'uri'
require 'net/http'
require 'openssl'
require 'byebug'
# commented out and hard coded while debugging
#@dbconfig = YAML.load(File.read("./config/database.yml"))
ActiveRecord::Base.establish_connection(
adapter: 'sqlserver',
host: '10.xxx.xxx.xx',
post: '1433',
database: 'mydb',
username: '***',
password: '***'
)