Error "no such file to load" -- sqlite3/sqlite3_native (LoadError)
Asked Answered
E

5

10

My OS is Windows 7.

My problem is that when I try to run rails server, an error occurs. I have installed the sqlite3 gem, even the sqlite-ruby gem, and still nothing.

I already don't know what to do anymore.

If anyone needs any additional information, ask for it and I'll put it up.

The complete error is:

C:/Ruby192/lib/ruby/gems/1.9.1/gems/sqlite3-1.3.3-x86-mingw32/lib/sqlite3.rb:6:in `require': no such file to load -- sqlite3/sqlite3_native (LoadError)
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/sqlite3-1.3.3-x86-mingw32/lib/sqlite3.rb:6:in `rescue in <top (required)>'
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/sqlite3-1.3.3-x86-mingw32/lib/sqlite3.rb:2:in `<top (required)>'
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.12/lib/bundler/runtime.rb:68:in `require'
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.12/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.12/lib/bundler/runtime.rb:66:in `each'
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.12/lib/bundler/runtime.rb:66:in `block in require'
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.12/lib/bundler/runtime.rb:55:in `each'
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.12/lib/bundler/runtime.rb:55:in `require'
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.12/lib/bundler.rb:120:in `require'
    from C:/Users/JorWan/Desktop/JorWan/ASCENDSTUDIO/RoR/intento2/config/application.rb:7:in `<top (required)>'
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.7/lib/rails/commands.rb:28:in `require'
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.7/lib/rails/commands.rb:28:in `block in <top (required)>'
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.7/lib/rails/commands.rb:27:in `tap'
    from C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.7/lib/rails/commands.rb:27:in `<top (required)>'
    from script/rails:6:in `require'
    from script/rails:6:in `<main>'
Emulsoid answered 27/4, 2011 at 7:44 Comment(1)
Ah, sorry, i forgot to say that this error occur when i try to do a "rails server"Postcard
T
4

download the required executable and the dll from http://www.sqlite.org/download.html extract to your ruby's bin (c:\Ruby192\bin)

Tita answered 25/5, 2011 at 14:30 Comment(0)
C
3

Forget all the so called "answers", 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!

Crymotherapy answered 30/6, 2017 at 10:33 Comment(0)
T
1

Is that file (/sqlite3/sqlite3_native) in your PATH environment variable? It will need to be in order for that gem to work. If you need to check try using echo %PATH% on the command prompt. If it ends up that you need to add it to your path you can either SET PATH=%PATH%;C:\Path\To\Sqlite3 or change your environment variables by selecting the Properties\Advances\Environment Variables option after right-clicking on My Computer. Edit the path variable to contain your path and viola!

Tenishatenn answered 27/4, 2011 at 7:54 Comment(6)
no really :/ , but, how can i do that? i means, it is a rubygem, no? why and/or how i would do that?Postcard
i have already the ruby bin on the environment variables setted, and, the sqlite3 is there, knowing this, i need to set anything else yet?Postcard
could you show me the path that you have to see an example or idea more or less that how or where it is?Postcard
he already told you how to check your PATH variable - echo %PATH% on the command prompt or selecting the Properties\Advances\Environment Variables option after right-clicking on My ComputerHutt
i am no asking that, i means, i am asking an example of printscreen of his PATH to see more or less where can i get the url of sqlite3 on my pc and to see how he has setted the PATHPostcard
My sqlite.dll and all of the other resources are located nicely in my C:\Ruby\Ruby1.8.7\bin folder. If you're really having so much difficulty, and you're going to be developing in Rails, you may want to just use the RailsInstaller [www.railsinstaller.org].Tenishatenn
X
1

This URL provides the step-wise description and solution. Hope it works for you. http://rubyonwindowsguides.github.io/book/ch02-05.html

Xerxes answered 30/6, 2013 at 11:21 Comment(1)
I followed this tutorial to the letter and I can not successfully build the native libraries needed for the sqlite3 gem. Also, the commands used in the tutorial don't reflect the current file names of the linked .tar file which the author insists you download, so several commands need to be edited.Jeffersonjeffery
E
0

If you have extracted "exe"s and "dll"s from Sqlite download link to Ruby's bin folder and still have this problem. Try this:

bundle update

gem uninstall sqlite3

Given a choice between multiple versions of sqlite3, choose last option 'All versions'. Enter last number here

Select gem to uninstall:
1. sqlite3-1.3.13
2. sqlite3-1.3.13-x64-mingw32
3. All versions
>3 .
.
If you remove this gem, these dependencies will not be met.
Continue with Uninstall? [yN]
> y

gem install sqlite3 --platform=ruby

rails server

This should work.

Read through this link for more explanation if above works for you.

Enervated answered 15/10, 2018 at 12:44 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.