43014


[前回の質問](https://ja.stackoverflow.com/q/42963/19110)に引き続きお世話になります。

今度は、`rails s` で次のエラーがでます。

[code]

    C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/sqlite3-1.3.13-x64-mingw32/lib/sqlite3.rb:6:in `require': cannot load such file -- sqlite3/sqlite3_native (LoadError)
    
[/code]

`C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/sqlite3-1.3.13-x64-mingw32/lib/sqlite3.rb`をクリックすると、一瞬コンソールが現れてすぐ消えます。

昨日、Rubyをアンインストールし、関連フォルダも削除し、再度Rubyをインストールしました。  
今回は次のサイトを参考にしています。 <https://www.225-futures-trader.com/2017/10/171004-ruby-
tradingsystem-backtest-programming.html>

sqlite3のインストールについては、そのサイトの手順で行いました。

[code]

    ridk exec pacman -Ss sqlite3　で検索
    ridk exec pacman -S mingw-w64-x86_64-sqlite3
    gem install sqlite3 --platform ruby
    
[/code]

現在確認すると、

  * mingw64/mingw-w64-x86_64-sqlite3 3.21.0-1 [インストール済み] 
  * msys/libsqlite 3.19.3.0-2 (libraries) [インストール済み]

です。  
宜しくお願いします。

  * Windows10 Home 
  * ruby 2.5.1p57 (2018-03-29 revision 63029) [x64-mingw32]
  * Rails 5.1.6

以下、rails s の結果です。

[code]

    >rails s
    Traceback (most recent call last):
            22: from bin/rails:4:in `<main>'
            21: from bin/rails:4:in `require'
            20: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/railties-5.1.6/lib/rails/commands.rb:16:in `<top (required)>'
            19: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/railties-5.1.6/lib/rails/command.rb:44:in `invoke'
            18: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/railties-5.1.6/lib/rails/command/base.rb:63:in `perform'
            17: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/thor-0.20.0/lib/thor.rb:387:in `dispatch'
            16: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/thor-0.20.0/lib/thor/invocation.rb:126:in `invoke_command'
            15: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/thor-0.20.0/lib/thor/command.rb:27:in `run'
            14: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/railties-5.1.6/lib/rails/commands/server/server_command.rb:130:in `perform'
            13: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/railties-5.1.6/lib/rails/commands/server/server_command.rb:130:in `tap'
            12: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/railties-5.1.6/lib/rails/commands/server/server_command.rb:133:in `block in perform'
            11: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/railties-5.1.6/lib/rails/commands/server/server_command.rb:133:in `require'
            10: from C:/Users/〇〇〇〇/map/config/application.rb:7:in `<top (required)>'
             9: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/bundler-1.16.1/lib/bundler.rb:114:in `require'
             8: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/bundler-1.16.1/lib/bundler/runtime.rb:65:in `require'
             7: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/bundler-1.16.1/lib/bundler/runtime.rb:65:in `each'
             6: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/bundler-1.16.1/lib/bundler/runtime.rb:76:in `block in require'
             5: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/bundler-1.16.1/lib/bundler/runtime.rb:76:in `each'
             4: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/bundler-1.16.1/lib/bundler/runtime.rb:81:in `block (2 levels) in require'
             3: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/bundler-1.16.1/lib/bundler/runtime.rb:81:in `require'
             2: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/sqlite3-1.3.13-x64-mingw32/lib/sqlite3.rb:2:in `<top (required)>'
             1: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/sqlite3-1.3.13-x64-mingw32/lib/sqlite3.rb:6:in `rescue in <top (required)>'
    C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/sqlite3-1.3.13-x64-mingw32/lib/sqlite3.rb:6:in `require': cannot load such file -- sqlite3/sqlite3_native (LoadError)
    
[/code]

以下は sqlite3 の検索です。

[code]

    >ridk exec pacman -Ss sqlite3
    mingw32/mingw-w64-i686-lua51-lsqlite3 0.9.3-1
        LuaSQLite is a Lua 5 binding to allow users/developers to manipulate SQLite
        2 and SQLite 3 databases (through different implementations) from lua
    mingw32/mingw-w64-i686-python2-sqlitedict 1.5.0-1
        Persistent dict, backed by sqlite3 and pickle, multithread-safe (mingw-w64)
    mingw32/mingw-w64-i686-python3-sqlitedict 1.5.0-1
        Persistent dict, backed by sqlite3 and pickle, multithread-safe (mingw-w64)
    mingw32/mingw-w64-i686-sqlite3 3.21.0-1
        A C library that implements an SQL database engine (mingw-w64)
    mingw64/mingw-w64-x86_64-lua51-lsqlite3 0.9.3-1
        LuaSQLite is a Lua 5 binding to allow users/developers to manipulate SQLite
        2 and SQLite 3 databases (through different implementations) from lua
    mingw64/mingw-w64-x86_64-python2-sqlitedict 1.5.0-1
        Persistent dict, backed by sqlite3 and pickle, multithread-safe (mingw-w64)
    mingw64/mingw-w64-x86_64-python3-sqlitedict 1.5.0-1
        Persistent dict, backed by sqlite3 and pickle, multithread-safe (mingw-w64)
    mingw64/mingw-w64-x86_64-sqlite3 3.21.0-1 [インストール済み]
        A C library that implements an SQL database engine (mingw-w64)
    msys/libsqlite 3.19.3.0-2 (libraries) [インストール済み]
        Sqlite3 library
    msys/libsqlite-devel 3.19.3.0-2 (development)
        Sqlite3 headers and libraries
    msys/sqlite 3.19.3.0-2
        A C library that implements an SQL database engine
    msys/sqlite-doc 3.19.3.0-2
        Most of the static HTML files that comprise this website, including all of
        the SQL Syntax and the C/C++ interface specs and other miscellaneous
        documentation
    
[/code]


CC BY-SA 3.0
2018-04-06T02:48:24.110
42982
2018-11-10T12:39:25.980
2018-04-06T13:32:03.810
19110
27264
question
ruby-on-rails
rails s で sqlite3関連の (LoadError) がでます。


`C:\Ruby25-x64\lib\ruby\gems\2.5.0\gems\sqlite3-1.3.13-x64-mingw32\lib\sqlite3\`
に `2.5` というディレクトリがないと思います。  
sqlite3 の x64-mingw32 用 gem がまだ ruby 2.5 に対応していないということです。  
今のところはまだ ruby 2.4 系を使っておくのが良いと思います。

また、`gem install sqlite3 --platform=ruby` で
`C:\Ruby25-x64\lib\ruby\gems\2.5.0\gems\sqlite3-1.3.13` (`-x64-mingw32` でなく)
にインストールされ、sqlite3_native.so も作られるようですが、rails からは使われないようです。


CC BY-SA 3.0
2018-04-06T13:56:37.377
43014
2018-04-06T13:56:37.377
5288
42982
answer