Rails on Windows connects to Microsoft SQL Server - "no such file to download - odbc"

I am trying to connect a Rails application on a Windows machine to SQL Server using activeerecord-sqlserver-adapter. I created a DSN that works great.

When I try to perform a migration (or any database operation), they tell me:

"no such file to download - odbc"

My database.yaml file has the following:

development:
  adapter: sqlserver
  mode: odbc
  dsn: rails_import

I used the ruby ​​installer with one click, which I thought installed any gems needed for odbc. Maybe I'm wrong.

How do I get through this error? I was googling for an hour without any luck. Thanks in advance.

+3
source share
2

! ( , - ).

Ruby , "odbc" . , RubyInstaller ( ). , ruby-odbc.

, , C. , RubyInstaller . .

run: gem install ruby-odbc. .

+9

, dbi dbd-odbc:

gem install dbi
gem install dbd-odbc

, DSN database.yml:

dsn: Driver={SQL Native Client};Server=.\SQLEXPRESS;Database=rails_database_name;
0

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


All Articles