There is a chance I will have to make a project using RoR with a SQL Server 2008 r2 database. Is there any complication with using sql server as opposed to mysql when it comes to developing with RoR?
The only difference between the mysql adapter and the SQLServer adapter is that the later depends on the freetds gem. And when you first setup up your connection, you may have to deal with some simple utilities that come with freetds to verify or debug the connection. Once you are connecting, there is no difference in the way you deal with the database, no where in your RoR code is ANYTHING specific to SQLServer vs. mysql, it's all handled by the SQLServer adapter and freetds.
Shouldn't be too much of an issue; see this screencast on Rails 3, Ruby 1.9.2, Windows 2008, and SQL Server 2008 by Xavier Shay.
If you do run into issues while working on this project, StackOverflow is always there to rescue you ;-)
Related
The Ruby on Rails project I've just started on will need to use MS SQL Server at some deployments, and PostgreSQL at other deployments. It won't be connecting to SQL Server and PGSQL at the same time: just one or the other depending on the deploy location. I'm new to Rails and SQL Server, so I'm not sure if this is doable/feasible? I'm thinking Rails' ActiveRecord layer (along with the pg and activerecord-sqlserver-adapter gems) should abstract away which RDBMS system I am using, so that it should just work, but I'm sure there are scenarios that I haven't thought of yet. Does anyone have any experience with this kind of deployment-dependent DB setup (or just know more about RoR/RDBMS) and can give me some advice?
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
Then I am connected to this remote database :
In rubymine I use the Gems:
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:
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)
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
I fixed it on myself:
Just replace the comma with a double point
dataserver: 'domain.de:50021\xxxxxxSQLServer'
DAMN YOU WINDOWS
Can anyone show me some simple steps to configure ruby on rails to work with SQL Server 2008?
The development is being done on windows..
Thanks
I think that this article can help you. It shows you how to configure SQL Server 2008 with Rails 2.
This has been addressed some time ago, but I've not had any luck following the steps outlined or advice suggested. Here's my situation:
I've installed SQL Server '05 and have another (non-Ruby) application utilizing it successfully.
I've got Rails up and running successfully (but only for MySQL.)
I've installed the Rails sqlserver adapter gem (as well as its dependencies.)
I've downloaded ADO.rb (now only available on older builds of Ruby-DBI) and placed it into c:\ruby\lib\ruby\site_ruby\1.8\DBD\ADO\ADO.rb.
I've configured database.yml to use the sqlserver adapter and pointed it towards my database with valid login information.
When I attempt to run a migration, I get the ugly 'Unable to load driver ADO (uninitialized constant DBI::DBD::ADO)' error.
Thanks immensely for any assistance.
So just make sure if you're working on Windows or Mac to set up an ODBC connection. You must indicate this explicitly in your database configuration for Rails.
I have an older database Oracle RDB. I used ODBC on Windows with .net, but I'm not sure how to proceed on RoR on a Mac OS X server. I don't know how I do it on Windows either with RoR.
I was hoping for general direction.
EDIT: I searched for activerecord and rdb but have nto found it yet. I saw references to rdb$database and so on in code for firebird but that's it.
How old? because there are some resources for Rails and Oracle, like this
http://www.oracle.com/technology/pub/articles/haefel-oracle-ruby.html
or maybe you could try with JRuby and JDBC, it's super easy, you have to copy the oracle jdbc jar file in the jruby/lib folder, and then in the rails project setup your database (config/database.yml) like this
production:
adapter: jdbc
driver: oracle.jdbc.OracleDriver
url: jdbc:oracle:thin:#you_server_address:1521:instanceName
username: user
password: pass
You need to use the Oracle Rdb specific JDBC driver. Go to http://www.oracle.com/technetwork/database/rdb/index-090638.html
This question shows how to configure RoR with Oracle on linux and mac:
How to configure Ruby on Rails with Oracle?
Oracle RDB is different from Oracle RDBMS