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

后端 未结 18 1601
遇见更好的自我
遇见更好的自我 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 10:02

    Find your sqlite3 gemspec file. One example is /usr/local/share/gem/specifications/sqlite3-1.3.7.gemspec

    Windows: C:\Ruby21\lib\ruby\gems\2.1.0\specifications.

    You should adjust according with your Rubygem path and sqlite3 version. Edit the file above and look for the following line

    s.require_paths=["lib"]
    

    change it to

    s.require_paths= ["lib/sqlite3_native"]
    
    0 讨论(0)
  • 2020-11-22 10:02
    gem uninstall sqlite3 --all
    ridk exec pacman -S mingw-w64-x86_64-sqlite3
    gem inst sqlite3 --platform ruby
    

    This solved the problem to me.

    Windows 10
    Ruby 2.5.3
    Rails 5.2.2
    
    0 讨论(0)
  • 2020-11-22 10:06

    This happened to me as well. It turned out that I had originally installed SQLite 1.3.10, but then I copied some gems from the Rails tutorial screencasts project and it listed SQLite 1.3.9. Then I got the same error you did. I changed it back to 1.3.10 and it worked.

    (This is on Windows 7. I was running the screencast tutorial on Cloud9 IDE).

    0 讨论(0)
  • 2020-11-22 10:08

    Uninstalling and reinstalling the sqlite3 gem worked for me.

    gem uninstall sqlite3
    
    bundle
    
    0 讨论(0)
  • 2020-11-22 10:10

    No compiling of the sources or downloading pre-compiled libraries will solve this problem, believe me I tried everything, the problem lies somewhere else. This is how it works on windows:

    bundle update sqlite3

    You likely get another similar error after this one regarding nokogiri, fix it with the command:

    bundle update nokogiri

    Enjoy your Ruby App!

    0 讨论(0)
  • 2020-11-22 10:11

    i found it! i saw this https://www.youtube.com/watch?v=lsrzvX0qzmA
    i instaled: Rails version: 5.2.1 Ruby version: 2.5.3 (x64-mingw32) Sqlite version 1.3.13
    and i have your problem... my solution:

    1. In your installing folder like C:\Ruby25-x64\lib\ruby\gems\2.5.0\gems\
      you have folders: "sqlite3-1.3.13" "sqlite3-1.3.13-x64-mingw32"
    2. Find file
      C:\Ruby25-x64\lib\ruby\gems\2.5.0\gems\sqlite3-1.3.13\lib\sqlite3\sqlite3_native.so
    3. Copy it in C:\Ruby25-x64\lib\ruby\gems\2.5.0\gems\sqlite3-1.3.13-x64-mingw32\lib\sqlite3\2.5\sqlite3_native.so (may be folders not exist - create and paste)
    0 讨论(0)
提交回复
热议问题