Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
657 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 Answer

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...