cannot load such file — sqlite3/sqlite3_native (LoadError) on ruby on rails

后端 未结 18 2028
遇见更好的自我
遇见更好的自我 2020-11-22 09:39

When I try to setup basic installation and initiation of server using Rails 4.0.0 on Ruby 2.0.0, I\'m facing the following error message.

/usr/local/lib/ruby         


        
18条回答
  •  鱼传尺愫
    2020-11-22 09:50

    This is the only solution worked for me, derived from this GitHub issue post:

    1. Get autoconf version of sqlite3 sources from https://www.sqlite.org/download.html.
    2. Start MSYS shell.
    3. In unpacked location for your sqlite3, configure static version only to avoid keeping DLL on PATH: ./configure --disable-shared.
    4. Build and install it: make install DESTDIR=/c/dev/ruby/tmp. You can change the directory.
    5. Open command prompt of windows and run gem uninstall sqlite3 --all to remove all existing sqlite3 gems.
    6. Again on command prompt of windows, build and install sqlite3 gem: gem install sqlite3 --platform=ruby -- --with-sqlite3-include=C:\dev\ruby\tmp\usr\local\include --with-sqlite3-lib=C:\dev\ruby\tmp\usr\local\lib. Those include and lib directories may be different, so check at first.

    I am using Ruby version 2.5.1 and Rails version 5.2.0 on Windows 10.

提交回复
热议问题