# No such file to load -- sqlite3

**URL:** <https://www.ruby-forum.com/t/no-such-file-to-load-sqlite3/175337>\
**Category:** Ruby\
**Created:** [September 11, 2009, 1:32pm UTC](https://www.ruby-forum.com/t/no-such-file-to-load-sqlite3/175337 "2009-09-11T13:32:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![polunochnik](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/65b543/32.png) [@polunochnik](https://www.ruby-forum.com/u/polunochnik)\
**Post date:** [September 11, 2009, 1:32pm UTC](https://www.ruby-forum.com/t/no-such-file-to-load-sqlite3/175337/1 "2009-09-11T13:32:02Z")

</div>

Hi.

I’ve just installed the sqlite3-ruby gem, but when I require it, I’m  
getting the load error.

gem list  
…  
sqlite3-ruby (1.2.5)  
…

ruby -e “require ‘sqlite3’”  
…  
no such file to load – sqlite3 (LoadError)  
…

What is the reason of the bug? How can I fix it?

OS Debian GNU/Linux 5.0.3, Ruby 1.9.1.

Thanks.

---

<div class="post-metadata">

**Author:** ![polunochnik](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/65b543/32.png) [@polunochnik](https://www.ruby-forum.com/u/polunochnik)\
**Post date:** [September 11, 2009, 1:55pm UTC](https://www.ruby-forum.com/t/no-such-file-to-load-sqlite3/175337/2 "2009-09-11T13:55:04Z")

</div>

Hi,

Am Freitag, 11. Sep 2009, 20:32:10 +0900 schrieb P. A.:

> no such file to load – sqlite3 (LoadError)  
> …
> 
> What is the reason of the bug? How can I fix it?
> 
> OS Debian GNU/Linux 5.0.3, Ruby 1.9.1.

First search for it:

$ find /usr/lib/ruby -name ‘_sqlite3_’  
or  
$ rbfind /usr/lib/ruby -pD sqlite3 # (I prefer to use my own tool)

Then check the search path

$ ruby -e ‘puts $:’

Bertram

---

<div class="post-metadata">

**Author:** ![polunochnik](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/65b543/32.png) [@polunochnik](https://www.ruby-forum.com/u/polunochnik)\
**Post date:** [September 11, 2009, 3:18pm UTC](https://www.ruby-forum.com/t/no-such-file-to-load-sqlite3/175337/3 "2009-09-11T15:18:29Z")

</div>

The problem was I set the custom gemdir on /home/\<user\_name\>/.gem and  
doesn’t set the GEM\_HOME and the RUBYLIB environment variables.

When I set GEM\_HOME=/home/\<user\_name\>/.gem and  
RUBYLIB=/home/\<user\_name\>/.gem/ruby/1.9.1/gems then the gems installator  
start inculde the new gemlib’s paths in â€˜$:â€™.

Anyway thanks for the help.
