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>'
Colonel Thirty Two
  • 23,953
  • 8
  • 45
  • 85

5 Answers5

4

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

HQM
  • 558
  • 1
  • 3
  • 15
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!

Norman Seßler
  • 154
  • 1
  • 3
1

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

Deepak Lamichhane
  • 19,076
  • 4
  • 30
  • 42
  • 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. –  Jul 03 '15 at 14:51
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!

Kyle Sletten
  • 5,365
  • 2
  • 26
  • 39
  • 1
    no really :/ , but, how can i do that? i means, it is a rubygem, no? why and/or how i would do that? – Jorge Wander Santana Ureña Apr 27 '11 at 08:06
  • 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? – Jorge Wander Santana Ureña Apr 27 '11 at 08:15
  • could you show me the path that you have to see an example or idea more or less that how or where it is? – Jorge Wander Santana Ureña Apr 27 '11 at 08:36
  • 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 Computer` – Max Williams Apr 27 '11 at 08:42
  • 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 PATH – Jorge Wander Santana Ureña Apr 28 '11 at 03:44
  • 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]. – Kyle Sletten Apr 28 '11 at 06:01
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.