September 21st, 2012, 10:23 AM
How do you use and exisitng DB with Ruby
I seem to be going round in circles trying to understand how I use an existing MS SQL Database with RoR, also how do I set up my applicaiton to use two MS SQL servers in different locations (different IP addresses and DSN's)
I have edited the database.yml following instructions on the web http://www.myclojureadventure.com/2010/10/getting-rails-3-up-on-windows.html , but that only seems to be for a single SQL server / DSN, my app needs to use more than one SQL server, so where do I put that info.. this is what I currently have
Also the instructions then say to run : 'rake db:create' , Do I want to do this? I don't want to create a DB, I want to use an exisiting one
# SQLite version 3.x
# gem install sqlite3
# Ensure the SQLite 3 gem is defined in your Gemfile
# gem 'sqlite3'
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
Is this creating the DB in SQL or in the application?
I'm very confused with all this and appreciate your assistance.
October 9th, 2012, 01:51 AM
You need not use db:migrate as you have an existing database. db:migrate is used to add new modifications to the database in rails.
It would have been good if you would have shared your db schema. But the following gem can help you in getting started: https://github.com/bosko/rmre
Also, refer to following pages to understand how you can connect to multiple databases.
http://stackoverflow.com/questions/1404620/using-rails-migration-on-different-database-than-standard-production-or-devel (See the response from Marlin Pierce).
I hope that helps you.
October 10th, 2012, 09:24 AM
Thanks, but I've uninstalled RoR, it's all to much command line this and command line that, I can't get to grips with it and can't do something as simple as write a couple of lines of code to get some data out of SQL.
I'm thinking I might look at Python instead, or simply stick with perl and use a framework with that instead.
October 20th, 2012, 06:51 AM
ruby on rails developers
Ruby on rails web development has made available most of the e-commerce sites to use user-friendly features and moulder approach.