Ruby Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesRuby Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old September 21st, 2012, 10:23 AM
1DMF's Avatar
1DMF 1DMF is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2009
Posts: 320 1DMF User rank is Captain (20000 - 30000 Reputation Level)1DMF User rank is Captain (20000 - 30000 Reputation Level)1DMF User rank is Captain (20000 - 30000 Reputation Level)1DMF User rank is Captain (20000 - 30000 Reputation Level)1DMF User rank is Captain (20000 - 30000 Reputation Level)1DMF User rank is Captain (20000 - 30000 Reputation Level)1DMF User rank is Captain (20000 - 30000 Reputation Level)1DMF User rank is Captain (20000 - 30000 Reputation Level)1DMF User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 3 Days 16 h 57 m 54 sec
Reputation Power: 227
How do you use and exisitng DB with Ruby

Hi,

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
Code:
# SQLite version 3.x
#   gem install sqlite3
#
#   Ensure the SQLite 3 gem is defined in your Gemfile
#   gem 'sqlite3'
development:
    adapter: sqlserver
    mode: odbc
    dsn: my_dsn
    username: my_username
    password: my_password
    host: server_ip
    database: my_dev_database

# 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.
test:
    adapter: sqlserver
    mode: odbc
    dsn: my_dsn
    username: my_username
    password: my_password
    host: server_ip
    database: my_test_database

production:
    adapter: sqlserver
    mode: odbc
    dsn: my_dsn
    username: my_username
    password: my_password
    host: server_ip
    database: my_production_database


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

Is this creating the DB in SQL or in the application?

I'm very confused with all this and appreciate your assistance.

Thanks,

1DMF
__________________
Free MP3 Dance Music Downloads

To err is human; To really balls things up you need Microsoft!

Reply With Quote
  #2  
Old October 9th, 2012, 01:51 AM
techMonster techMonster is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2005
Posts: 107 techMonster User rank is Lance Corporal (50 - 100 Reputation Level)techMonster User rank is Lance Corporal (50 - 100 Reputation Level)techMonster User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 20 h 8 m 58 sec
Reputation Power: 9
Send a message via Yahoo to techMonster Send a message via Google Talk to techMonster
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://bitblender.blogspot.in/2008/10/connecting-to-multiple-database-in-ruby.html

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.
__________________
@ PresentSoft Technologies Pvt. Ltd. we develop scalable applications using on Ruby on Rails and Android.

My blog @ AnayKamat.com

Reply With Quote
  #3  
Old October 10th, 2012, 09:24 AM
1DMF's Avatar
1DMF 1DMF is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2009
Posts: 320 1DMF User rank is Captain (20000 - 30000 Reputation Level)1DMF User rank is Captain (20000 - 30000 Reputation Level)1DMF User rank is Captain (20000 - 30000 Reputation Level)1DMF User rank is Captain (20000 - 30000 Reputation Level)1DMF User rank is Captain (20000 - 30000 Reputation Level)1DMF User rank is Captain (20000 - 30000 Reputation Level)1DMF User rank is Captain (20000 - 30000 Reputation Level)1DMF User rank is Captain (20000 - 30000 Reputation Level)1DMF User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 3 Days 16 h 57 m 54 sec
Reputation Power: 227
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.

Cheers,
1DMF.

Reply With Quote
  #4  
Old October 20th, 2012, 06:51 AM
shanucis shanucis is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2012
Posts: 2 shanucis User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 17 m 44 sec
Reputation Power: 0
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.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesRuby Programming > How do you use and exisitng DB with Ruby

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap