Viktor Carlson
Viktor Carlson

Reputation: 1008

Ruby on Rails Set up MS SQL Connection to remote Database in database.yml

I want to connect my Ruby On Rails Application ( developed with ruby mine ) with a MS SQL Server 2008 R2 running on an external PC.

I can connect with Microsoft SQL Server Management Studio running on the same PC where Ruby mine is running to the remote Database in this way:

Server name is: domain.de,PORT\SQLServerName

enter image description here

Then I am connected to this remote database : enter image description here

In rubymine I use the Gems:

enter image description here

Now I can use adapter: sqlserver in the database.yml without an error.

But I have no clue how to connect to the remote database:

I tired several example configurations like:

enter image description here

When I run the app in development mode I get this error:

C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/tiny_tds-0.6.1-x86-mingw32/lib/tiny_tds/client.rb:77:in `connect': Server name not found in configuration files (TinyTds::Error)

enter image description here

Can Anybody help me with the syntax for the database.yml that it can use the input data I also use to connect with MS SQL Server Management Studio to the remote Database

Upvotes: 0

Views: 2095

Answers (1)

Viktor Carlson
Viktor Carlson

Reputation: 1008

I fixed it on myself:

Just replace the comma with a double point

dataserver: 'domain.de:50021\xxxxxxSQLServer'

DAMN YOU WINDOWS

Upvotes: 1

Related Questions