rails-sqlserver / tiny_tds

TinyTDS - Simple and fast FreeTDS bindings for Ruby using DB-Library.
Other
607 stars 189 forks source link

Rails on mac not working with ms sql server in docker container #433

Closed ghost closed 3 years ago

ghost commented 5 years ago

I have MS SQL Server running an existing database on my Mac in a Docker container.

I am using the TinyTDS and the Rails SQL Server Adapter gems to try and read from the database in my Rails app.

When I run "rails server" for the first time I get this error:

Unable to connect: Adaptive Server is unavailable or does not exist (172.17.0.2:1433) My database.yml looks like this:

default: &default
  adapter: sqlserver
  pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
  timeout: 5000
  host: 172.17.0.2
  username: sa 
  password: abcd

development: 
  adapter: sqlserver
  database: SPDEMO
  username: sa 
  password: abcd
  host: 172.17.0.2

The Mac app Azure Data Studio running locally on the Mac can read the data from the database in the container.

Any guidance welcome?

Thanks