First, we need to have installed unixodbc and freetds in our Linux server, in this case Ubuntu 14.04:
And configure freetds:
Cause we need odbc, we need to configure odbc as follow:
And then:
Now we can test our connection to the database:
Now that we are able to access to MSSQL we have to add two gems to rail app Gemfile in order to acces from our application then reconfigure database.yml:
Also if we want to connet to multiple databases the only thing we have to do is modify the database.yml to add our new MSSQL database and create a model to establish the connection: