Testing and " Server name not found in configuration files"

270 views
Skip to first unread message

Michael Timko

unread,
Mar 7, 2014, 1:10:40 PM3/7/14
to rails-sqlse...@googlegroups.com

So I have a rails app that has the following configuration that works:

#database.yml
development:
  adapter: sqlserver
  host: valid_db_host #valid_db_host is part of my local network
  database: valid_db
  username: user
  password: pass

I want to add tests to said app, so i created a test db on the same box and added this to my database.yml:
development:
  adapter: sqlserver
  host: valid_db_host
  database: valid_db_test
  username: user
  password: pass

When i try to run my tests I get:
TinyTds::Error: Server name not found in configuration files

My tinytds.conf file has the default stuff in it (I did not change it because the dev db works)

The weird thing is if i run 'rails c test' it works 

Any ideas?
Thanks
Mike



This email (including any attachments) contains information from the corporate offices of OmniSpear, Inc. and is privileged and confidential. The information is intended only for the use of the person(s) or entity named above. If you are not an intended recipient of this message, you are hereby notified that any disclosure, copying, distribution, use of, or any other action based on the contents of this message is strictly prohibited and may be unlawful. If you received this email in error, please notify us by telephone at (937) 643-4037 immediately and permanently destroy it and any copies from your system. Thank you for your cooperation.

KLausG

unread,
Mar 26, 2014, 5:51:08 AM3/26/14
to rails-sqlse...@googlegroups.com

So I have a rails app that has the following configuration that works:

#database.yml
development:
  adapter: sqlserver
  ....

I want to add tests to said app, so i created a test db on the same box and added this to my database.yml:
development:
  adapter: sqlserver
  ....

When i try to run my tests I get:
TinyTds::Error: Server name not found in configuration files

My tinytds.conf file has the default stuff in it (I did not change it because the dev db works)

The weird thing is if i run 'rails c test' it works 

Any ideas?
Thanks
Mike

Yes, you now have TWO "development:" sections in your database.yml, Rename the second one to "test:"

Klaus

Reply all
Reply to author
Forward
0 new messages