简体   繁体   中英

System DSN not working when running Rails as Windows Service

When I run the mongrel server in a command window everything works fine, database connections are made and the app is running properly. If I set the Windows Service to run my app by logged in with my user credentials it works fine as well. However, when I set the Service to run as Local System I cannot get the application to start and the log file shows the following error;

Status: 500 Internal Server Error IM014 (0) [Microsoft][ODBC Driver Manager] The specified DSN contains an architecture mismatch between the Driver and Application

I am running on Windows 7 64bit, and I have tried using odbcad32.exe to create the System DSN and the User DSN. Can anyone lend a hand, what am I missing?

I don't know why I started to look at the problem from a different angle, but found the solution.. Actually the ODBC Data Source Administrator application I was thinking I had to use (from %windir%\\system32\\odbcad32.exe) was incorrect. When running the application as a Windows Service I needed to have a System DSN setup for the 64bit version of ODBC Data Source Administrator (%windir%\\SysWOW64\\odbcad32.exe). I setup a System DSN using the correct ODBC Data Source Administrator program and my app is working fine.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM