Ruby on Rails and MS SQL EXPRESS

I want to create a RoR application using MS SQL Express, but I cannot figure out how to connect to the database. I tried

development:
adapter: sqlserver
database: historicDB
username: dxt
password: dxt
host: DBI:ADO:Provider=SQLNCLI;Data Source=localhost\SQLEXPRESS;InitialCatalog=historicDB;User Id=dxt;Password=dxt;

and

development:
adapter: sqlserver
database: historicDB
host: localhost\SQLEXPRESSS
username: dxt
password: dxt

I also installed dbi, dbd-odbc, activerecord-sqlserver-adapter, but now everything works, I always get

   ActiveRecord::ConnectionNotEstablished

on the welcome screen

+3
source share
3 answers

First, use the TinyTDS gem and familiarize yourself with this page when using a named instance. https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/wiki/Using-TinyTds

You should be able to do this:

development:
  adapter: sqlserver
  database: historicDB
  dataserver: localhost\SQLEXPRESSS
  username: dxt
  password: dxt
+3
source

You will find information on using dbi and dbi-odbc in old documents, but they are deprecated.

sqlserver- TinyTds:

: https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/wiki

+1

I have not used this in the same configuration as above, but this link may help: http://rob-rowe.blogspot.com/2010/10/getting-rails-3-up-on-windows.html

0
source

Source: https://habr.com/ru/post/1796032/


All Articles