# Sqlite3/sqlite3\_native (LoadError)

**URL:** <https://www.ruby-forum.com/t/sqlite3-sqlite3-native-loaderror/194423>\
**Category:** Rails\
**Created:** [September 5, 2010, 12:43am UTC](https://www.ruby-forum.com/t/sqlite3-sqlite3-native-loaderror/194423 "2010-09-05T00:43:32Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![laguna53](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/eb9ed0/32.png) [@laguna53](https://www.ruby-forum.com/u/laguna53)\
**Post date:** [September 5, 2010, 12:43am UTC](https://www.ruby-forum.com/t/sqlite3-sqlite3-native-loaderror/194423/1 "2010-09-05T00:43:32Z")

</div>

Hi,  
I have installed ruby 1.9.2, rubygems 1.3.7 and rails 3.0. created a  
demo application. when I start ‘rails server’ I get:  
‘require’: no such file to load – sqlite3/sqlite3\_native (LoadError)

any idea ?

Thank you.

Dani

---

<div class="post-metadata">

**Author:** ![laguna53](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/eb9ed0/32.png) [@laguna53](https://www.ruby-forum.com/u/laguna53)\
**Post date:** [September 5, 2010, 2:11pm UTC](https://www.ruby-forum.com/t/sqlite3-sqlite3-native-loaderror/194423/2 "2010-09-05T14:11:57Z")

</div>

Hi,  
the above appears when I do:  
C:\Rails\first\_app\>rails server  
C:/Ruby192/lib/ruby/gems/1.9.1/gems/sqlite3-ruby-1.3.1-x86-mingw32/lib/sqlite3.rb:6:in  
`require’: no such file to load – sqlite3/sqlite3\_native (LoadError)

Need hellllp. thanks.  
dani

---

<div class="post-metadata">

**Author:** ![laguna53](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/eb9ed0/32.png) [@laguna53](https://www.ruby-forum.com/u/laguna53)\
**Post date:** [September 5, 2010, 12:11pm UTC](https://www.ruby-forum.com/t/sqlite3-sqlite3-native-loaderror/194423/3 "2010-09-05T12:11:49Z")

</div>

# Hi, here is some more information. I’m using windows xp, sp3. Here is the content of the sqlite3.rb file where the error comes from:

# support multiple ruby version (fat binaries under windows)

begin  
RUBY\_VERSION =~ /(\d+.\d+)/  
require “sqlite3/#{$1}/sqlite3\_native”  
rescue LoadError  
require ‘sqlite3/sqlite3\_native’ \<------ THIS LINE CAUSES THE  
ERROR  
end

# require ‘sqlite3/database’ require ‘sqlite3/version’

Can’t go on working. Appreciat any help. Thanky.

Dani

---

<div class="post-metadata">

**Author:** ![laguna53](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/eb9ed0/32.png) [@laguna53](https://www.ruby-forum.com/u/laguna53)\
**Post date:** [September 5, 2010, 6:54pm UTC](https://www.ruby-forum.com/t/sqlite3-sqlite3-native-loaderror/194423/4 "2010-09-05T18:54:01Z")

</div>

Ok, found the problem causig this:  
I had to set --\> gem ‘sqlite3-ruby’, ‘1.2.5’, :require =\> ‘sqlite3’

in the Gemfile and comment out:  
gem ‘sqlite3-ruby’, :require =\> ‘sqlite3’

---

<div class="post-metadata">

**Author:** ![laguna53](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/eb9ed0/32.png) [@laguna53](https://www.ruby-forum.com/u/laguna53)\
**Post date:** [September 6, 2010, 4:39pm UTC](https://www.ruby-forum.com/t/sqlite3-sqlite3-native-loaderror/194423/5 "2010-09-06T16:39:35Z")

</div>

Does the file exist?

I can’t help much on windows, but have resolved similar issues on UNIX  
with a full path, not a relative path.

---

<div class="post-metadata">

**Author:** ![laguna53](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/eb9ed0/32.png) [@laguna53](https://www.ruby-forum.com/u/laguna53)\
**Post date:** [September 18, 2010, 10:23pm UTC](https://www.ruby-forum.com/t/sqlite3-sqlite3-native-loaderror/194423/6 "2010-09-18T22:23:48Z")

</div>

After a lot of debugging I tried to add

puts RUBY\_VERSION

sqlite3.rb file. This made me realized rails was somehow running an  
old jruby version. After even more debugging I realized I was actually  
running rails for jruby (hint: which rails, cat the rails file and  
look for #!..jruby in the top of the file). Reinstalling rails did the  
trick…

---

<div class="post-metadata">

**Author:** ![laguna53](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/eb9ed0/32.png) [@laguna53](https://www.ruby-forum.com/u/laguna53)\
**Post date:** [September 18, 2010, 10:23pm UTC](https://www.ruby-forum.com/t/sqlite3-sqlite3-native-loaderror/194423/7 "2010-09-18T22:23:48Z")

</div>

I got a similar error when installing ruby 1.9.2 for the first time.  
After a lot of frustration I finally discovered that when I added

puts RUBY\_VERSION

into the sqlite3.rb file, that rails somehow was using an old jruby  
version I had installed previously. After even more debugging I opened  
the the rails executable (which rails) and found it was actually  
declaring something like #!..jruby. So somehow I must have installed  
the rails gem for jruby… Uninstalling and reinstalling rails did the  
trick… Not sure how likely it is that anyone will have the same  
issue as I had though 😛

Cheers,

---

<div class="post-metadata">

**Author:** ![laguna53](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/eb9ed0/32.png) [@laguna53](https://www.ruby-forum.com/u/laguna53)\
**Post date:** [January 27, 2011, 8:48pm UTC](https://www.ruby-forum.com/t/sqlite3-sqlite3-native-loaderror/194423/8 "2011-01-27T20:48:49Z")

</div>

For me, I had to download and move the  
sqlite3.exe  
sqlite3.dll

into a folder in my path, like C:/Windows or for me c:/Ruby 1.9.2/bin/

Hope that helps

---

<div class="post-metadata">

**Author:** ![laguna53](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/eb9ed0/32.png) [@laguna53](https://www.ruby-forum.com/u/laguna53)\
**Post date:** [February 12, 2011, 7:26pm UTC](https://www.ruby-forum.com/t/sqlite3-sqlite3-native-loaderror/194423/9 "2011-02-12T19:26:25Z")

</div>

Guillaume N. wrote in post #977959:

> For me, I had to download and move the  
> sqlite3.exe  
> sqlite3.dll
> 
> into a folder in my path, like C:/Windows or for me c:/Ruby 1.9.2/bin/
> 
> Hope that helps

Thanks! Downloading the two files and putting them in the bin folder  
solved my problem, too.

> **[SQLite Download Page](https://www.sqlite.org/download.html)**
