# No such file to load -- sqlite3

**URL:** <https://rubytalk.org/t/no-such-file-to-load-sqlite3/55336>\
**Category:** ruby-talk\
**Created:** [11 September 2009 11:32 UTC](https://rubytalk.org/t/no-such-file-to-load-sqlite3/55336 "2009-09-11T11:32:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![P\_A](https://avatars.discourse-cdn.com/v4/letter/p/919ad9/32.png) [@P\_A](https://rubytalk.org/u/P_A)\
**Post date:** [11 September 2009 11:32 UTC](https://rubytalk.org/t/no-such-file-to-load-sqlite3/55336/1 "2009-09-11T11:32:10Z")

</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.

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).

---

<div class="post-metadata">

**Author:** ![Bertram\_Scharpf](https://avatars.discourse-cdn.com/v4/letter/b/43a26b/32.png) [@Bertram\_Scharpf](https://rubytalk.org/u/Bertram_Scharpf)\
**Post date:** [11 September 2009 11:53 UTC](https://rubytalk.org/t/no-such-file-to-load-sqlite3/55336/2 "2009-09-11T11:53:25Z")

</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.

First search for it:

&nbsp;&nbsp;$ find /usr/lib/ruby -name '\*sqlite3\*'  
&nbsp;&nbsp;or  
&nbsp;&nbsp;$ rbfind /usr/lib/ruby -pD sqlite3 # (I prefer to use my own tool)

Then check the search path

&nbsp;&nbsp;$ ruby -e 'puts $:'

Bertram

> **···**
>
> Am Freitag, 11. Sep 2009, 20:32:10 +0900 schrieb P. A.:
> 
> --  
> Bertram Scharpf  
> Stuttgart, Deutschland/Germany  
> [http://www.bertram-scharpf.de](http://www.bertram-scharpf.de)

---

<div class="post-metadata">

**Author:** ![P\_A](https://avatars.discourse-cdn.com/v4/letter/p/919ad9/32.png) [@P\_A](https://rubytalk.org/u/P_A)\
**Post date:** [11 September 2009 13:18 UTC](https://rubytalk.org/t/no-such-file-to-load-sqlite3/55336/3 "2009-09-11T13:18:31Z")

</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.

> **···**
>
> --  
> Posted via [http://www.ruby-forum.com/](http://www.ruby-forum.com/).
