# "no such file to load -- sqlite3" Rails

**URL:** <https://www.ruby-forum.com/t/no-such-file-to-load-sqlite3-rails/130821>\
**Category:** Rails\
**Created:** [March 3, 2008, 5:49pm UTC](https://www.ruby-forum.com/t/no-such-file-to-load-sqlite3-rails/130821 "2008-03-03T17:49:51Z")\
**Posts on this page:** 7\
**Page:** 2

<div class="post-metadata">

**Author:** ![liscoo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/ee7513/32.png) [@liscoo](https://www.ruby-forum.com/u/liscoo)\
**Post date:** [March 9, 2009, 1:25pm UTC](https://www.ruby-forum.com/t/no-such-file-to-load-sqlite3-rails/130821/21 "2009-03-09T13:25:23Z")

</div>

Did you install the dev package for sqlite3? All of these errors:

ERROR: Failed to build gem native extension.

Are related to the missing source files for Ruby libraries that are  
wrappers around native libraries.

–  
Aníbal Rojas

> **[Home - Has Many Developers](https://hasmanydevelopers.com/)**
>
> We are the best choice for your building design and development

> **[RUBYCORNER.COM](https://www.rubycorner.com/)**
>
> RUBYCORNER.COM - Contact us for any business inquiries

[http://en.anibal.rojas.com.ve](http://en.anibal.rojas.com.ve)

On Mar 9, 10:43 pm, Cyberg Cg [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![liscoo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/ee7513/32.png) [@liscoo](https://www.ruby-forum.com/u/liscoo)\
**Post date:** [March 9, 2009, 4:43am UTC](https://www.ruby-forum.com/t/no-such-file-to-load-sqlite3-rails/130821/22 "2009-03-09T04:43:40Z")

</div>

Sorry, I meant version 1.2.1 … since effort to install 1.2.2 were not  
successful … encountered same issues as listed in this thread.

thnaks  
cg

---

<div class="post-metadata">

**Author:** ![liscoo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/ee7513/32.png) [@liscoo](https://www.ruby-forum.com/u/liscoo)\
**Post date:** [April 26, 2009, 1:18pm UTC](https://www.ruby-forum.com/t/no-such-file-to-load-sqlite3-rails/130821/23 "2009-04-26T13:18:35Z")

</div>

M. Figueiroa wrote:

> In my case I just downloaded the sqllite3.dll from the  
> [SQLite Download Page](http://www.sqlite.org/download.html) (This is a DLL of the SQLite library  
> without the TCL bindings. The only external dependency is MSVCRT.DLL.)  
> and then copied it to the Windows\System32 folder. It worked.

MY PROBLEM HAS BEEN RESOLVED ITS WORKING NOW… im so very thankful to  
you Figueiro

---

<div class="post-metadata">

**Author:** ![liscoo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/ee7513/32.png) [@liscoo](https://www.ruby-forum.com/u/liscoo)\
**Post date:** [February 23, 2010, 9:18am UTC](https://www.ruby-forum.com/t/no-such-file-to-load-sqlite3-rails/130821/24 "2010-02-23T09:18:48Z")

</div>

Mojca M. wrote:

> Now I need to test (I have switched to mysql).
> 
> On the server I had a different issue (table created, but application  
> claimed it was not), so I have switched to mysql on both the local  
> machine and server.

I had a similar issue, but it turned out that I hadn’t run the db  
migration for the production environment, which is what I was running  
in. You could solve the issue without switching over to mysql for  
development by making sure that you’re running in the environment you  
intend. For me, running through apache using phusion passenger, this  
meant adding a RailsEnv value into the VirtualHost block in the  
appropriate apache .conf

---

<div class="post-metadata">

**Author:** ![liscoo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/ee7513/32.png) [@liscoo](https://www.ruby-forum.com/u/liscoo)\
**Post date:** [May 5, 2009, 4:34am UTC](https://www.ruby-forum.com/t/no-such-file-to-load-sqlite3-rails/130821/25 "2009-05-05T04:34:51Z")

</div>

Ehtsham Abbas wrote:

> M. Figueiroa wrote:
> 
> > In my case I just downloaded the sqllite3.dll from the  
> > [SQLite Download Page](http://www.sqlite.org/download.html) (This is a DLL of the SQLite library  
> > without the TCL bindings. The only external dependency is MSVCRT.DLL.)  
> > and then copied it to the Windows\System32 folder. It worked.
> 
> MY PROBLEM HAS BEEN RESOLVED ITS WORKING NOW… im so very thankful to  
> you Figueiro

For some reason this doesn’t work for me. I moved the dll file into my  
Windows\System32 folder and I get the same error.

---

<div class="post-metadata">

**Author:** ![liscoo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/ee7513/32.png) [@liscoo](https://www.ruby-forum.com/u/liscoo)\
**Post date:** [March 19, 2010, 11:18pm UTC](https://www.ruby-forum.com/t/no-such-file-to-load-sqlite3-rails/130821/26 "2010-03-19T23:18:00Z")

</div>

Robert Huberdeau wrote:

> Ehtsham Abbas wrote:
> 
> > M. Figueiroa wrote:
> > 
> > > In my case I just downloaded the sqllite3.dll from the  
> > > [SQLite Download Page](http://www.sqlite.org/download.html) (This is a DLL of the SQLite library  
> > > without the TCL bindings. The only external dependency is MSVCRT.DLL.)  
> > > and then copied it to the Windows\System32 folder. It worked.
> > 
> > MY PROBLEM HAS BEEN RESOLVED ITS WORKING NOW… im so very thankful to  
> > you Figueiro
> 
> For some reason this doesn’t work for me. I moved the dll file into my  
> Windows\System32 folder and I get the same error.

try downloading the precompiled files from:  
[SQLite Download Page](http://www.sqlite.org/download.html)

in windows you will need the  
sqlite3.def, sqlite3.dll, sqlite3.exe.  
Save this files to the Ruby/bin directory,  
then use the ‘gem install sqlite3-ruby’  
(you may get some definition error messages about the documentation but  
it shoud work anyways)

---

<div class="post-metadata">

**Author:** ![liscoo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/ee7513/32.png) [@liscoo](https://www.ruby-forum.com/u/liscoo)\
**Post date:** [November 16, 2011, 12:33am UTC](https://www.ruby-forum.com/t/no-such-file-to-load-sqlite3-rails/130821/27 "2011-11-16T00:33:39Z")

</div>

Check that you have gcc installed.

This error comes up if it is not installed, because of the method they  
use to check the existence of sqlite3.h: They simply try to compile this  
one-line program:

#include \<sqlite3.h\>

If the compilation fails, they tell you that sqlite3.h is missing, but  
the compilation will also fail if gcc is not present. It’s not a very  
smart check…

Lisa Concli wrote in post #641008:

> Hi to everyone!
> 
> I’m new with Ruby on Rails..  
> I use linux (an italian distribution, that is just like Slackware)
> 
> I’m writing my first program with rails.. Nothing special.. it is the  
> famous Hello World..!  
> (I’m reading the book of Dave T. “Agile Web D. with Rails”)
> 
> Well the problem is that when I point my browser to  
> [http://localhost:3000/dire/ciao](http://localhost:3000/dire/ciao)  
> (“dire” is my controller and “ciao” is the action)  
> the browser displays this problem:
> 
> MissingSourceFile in DireController#ciao
> 
> no such file to load – sqlite3
> 
> This error occurred while loading the following files:  
> sqlite3
> 
> So I write in my shell:  
> gem install sqlite3-ruby
> 
> The gem was installed, but the problem remains..!
> 
> Do you know what should I do?
> 
> I don’t know if I have to change something in the file database.yml..?  
> database.yml:
> 
> # SQLite version 3.x
> 
> # gem install sqlite3-ruby (not necessary on OS X Leopard)
> 
> development:  
> adapter: sqlite3  
> database: db/development.sqlite3  
> timeout: 5000
> 
> # Warning: The database defined as ‘test’ will be erased and
> 
> # re-generated from your development database when you run ‘rake’.
> 
> # Do not set this db to the same as development or production.
> 
> test:  
> adapter: sqlite3  
> database: db/test.sqlite3  
> timeout: 5000
> 
> production:  
> adapter: sqlite3  
> database: db/production.sqlite3  
> timeout: 5000
> 
> Can someone help me?  
> Thanks!!!
> 
> Lisa

[Previous page](https://www.ruby-forum.com/t/no-such-file-to-load-sqlite3-rails/130821.md?page=1)
