I am trying to connect to SQL Server from a Ruby on Rails Application.
I installed the gem activerecord-sqlserver-adapter
and realized from tutorials that I will need a DSN in order to connect to it.
I have 3 questions;
- Do I need to install the gem
ruby-odbc
in order for this sqlserver gem to work? - Are there any alternative ways of connecting to the db without using a DSN?
- Can I do scaffolding with RoR and 开发者_JAVA技巧SQL Server?
Thanks.
You really should be using TinyTDS (not ODBC) to connect to SQL Server. Have you looked at the project page on github and what they recommend on the wiki?
We even bundle prebuilt native gems for windows so they do not have to install FreeTDS too.
To answer your question:
- The sql-adapter is part of the Rails installation.
- There might be, but why not use dsn unless you can't
- Can't help you there, but if you use ActiveRecord as a base class, the contents of the database datastream are inferred from the metadata returned from the database.
See my response to the following question for some setup help:
Add SQL 2014 support to activerecord-sqlserver-adapter
精彩评论