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

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

    see:https://stackoverflow.com/a/39136421/6755206

    fortunately, you don't have to switch to ruby 2.0
    there is a solution to this issue, after endless trying...

    https://github.com/hwding/sqlite3-ruby-win


    Steps

    Pre

    • gem uninstall sqlite3 --all

    Source

    • Download the latest sqlite3-ruby, https://github.com/sparklemotion/sqlite3-ruby
    • unzip the package

    Build

    • run command-line in the extracted dir
    • make sure you have your C compiler installed and added to PATH
    • gem install bundler
    • bundle install
    • rake native gem
    • you'll find a dir named 'pkg' generated

    Install

    • enter dir 'pkg'
    • gem install --local sqlite3-xxx.gem ('xxx' is version code)

    Check

    • irb
    • require 'sqlite3'

提交回复
热议问题