Ruby cannot find sqlite3 driver on windows

前端 未结 8 2227
野趣味
野趣味 2021-02-08 10:21

I am trying to set up Ruby on Rails on windows. I am using the Flash Rails distribution that looks pretty good, but there is an issue with sqlite3. I found the threads telling m

8条回答
  •  星月不相逢
    2021-02-08 11:01

    Something similar happened to me recently so I thought I'd update my answer.

    For reference there's a sqlite3_api.dll file located in the gem's lib directory. Also the sqlite3.dll file needs to be reachable on the path. They are different files, the first is required by the gem to interface Ruby to C code, while the second contains the actual Sqlite implementation.

    It's best to get the second file from the sqlite website and extract it to the Ruby\bin directory (as you shouldn't manually put DLL's into the windows or windows\system directories any more).

    So for reference "sqlite3_api.dll" needs to be in:

    Ruby\lib\ruby\gems\1.8\gems\sqlite3-ruby-1.2.3-x86-mswin32\lib
    

    and "sqlite3.dll" needs to be on the path, possibly in:

    Ruby\bin
    

    As for the "driver not found" problem I would suggest trying the easy things first and making sure gems is installed correctly, up to date, and that the RUBYLIB and PATH environment variables are set appropriately. (System restart may be required to propagate the changes fully.)

提交回复
热议问题