Trouble getting the initial connection - rails 4.0, MS sql server

47 views
Skip to first unread message

Christopher Mendla

unread,
Nov 11, 2015, 5:45:45 PM11/11/15
to Rails SQLServer Adapter
Hello

I am having some problems getting an initial connect to my SQL database. I've tried a number of configurations with different failures.  I am trying to do a rake db:schema:load to load my development schema into my production db. 

The latest error is 

- create_table("advanced_searches", {:force=>:cascade})
rake aborted!
LoadError: cannot load such file -- odbc
C:/Users/cmendla/RubymineProjects/Rl2/db/schema.rb:16:in `block in <top (required)>'
C:/Users/cmendla/RubymineProjects/Rl2/db/schema.rb:14:in `<top (required)>'
-e:1:in `load'
-e:1:in `<main>'
Tasks: TOP => db:schema:load
(See full trace by running task with --trace)

Process finished with exit code 1


I tried setting up both an active directory and sql user. This is for the sql user. \

production:
<<: *default
# database: db/production.sqlite3
adapter: sqlserver
mode: odbc
dsn: rl2 # this is the name of my rails app
host: xxxxx # replaced real server name with xxxxx
database: cctweb
username: "appresearchlibrarysql"
password: "xxxx" # real password removed


appsresearchlibrarysql is a user on the sql server with sql authentication.  
  • user mapping to cctweb schema - dbo on cctweb


I'd appreciate any thoughts as to how to get a connection. I even tried this with the SA credentials for the sql server


thanks

chris

Christopher Mendla

unread,
Nov 12, 2015, 7:09:07 AM11/12/15
to Rails SQLServer Adapter
I have the connection working now. I changed the yml file to 

production:
   adapter: sqlserver
   
host: cprosql
   
port: 1435
   
database: cctweb
   
username: researchlibrary
   
password: xxxxxx
   
schema_search_path: rl_


I also tweaked the sql settings. Unfortunately I don't have a record of exactly what I tweaked. 
Reply all
Reply to author
Forward
0 new messages