Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
680 views
in Technique[技术] by (71.8m points)

ruby on rails - How to fix the [unixODBC][Driver Manager]Data source name not found, and no default driver specified (ODBC::Error)

/local/rvm/gems/ruby-1.9.2-p320/gems/activerecord-sqlserver-adapter-3.2.12/lib/active_record/connection_adapters/sqlserver_adapter.rb:455:in `initialize': IM002 (0) [unixODBC][Driver Manager]Data source name not found, and no default driver specified (ODBC::Error)

I have working copy of my app but suddenly overnight I left my system like that and this error started surfacing. Can anyone tell how to fix this one please?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

There is no definitive answer to your question since you gave us nothing to work on.

However, the possible reasons for this are:

  1. the DSN you specified could not be found in your user or system odbc.ini files Run odbcinst -j to find where those files are Has someone changed/removed them?

  2. You set ODBCINI env var or ODBCSYSINI env var to point unixODBC at the location of your odbc.ini and odbcinst.ini files and now they are not set (or changed).

  3. Someone has removed or moved your ODBC driver

  4. You normally run your code as user A and now you are running it as user B and you are using user datasources or set ODBCINI env var.

... probably others but if you'd given us better information we wouldn't have to guess.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...