# Cannot find header-files

**URL:** <https://www.ruby-forum.com/t/cannot-find-header-files/187313>\
**Category:** Ruby\
**Created:** [April 21, 2010, 3:49pm UTC](https://www.ruby-forum.com/t/cannot-find-header-files/187313 "2010-04-21T15:49:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mike343](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/58f4c7/32.png) [@mike343](https://www.ruby-forum.com/u/mike343)\
**Post date:** [April 21, 2010, 3:49pm UTC](https://www.ruby-forum.com/t/cannot-find-header-files/187313/1 "2010-04-21T15:49:54Z")

</div>

I am working here on Solaris and i have ruby-installation.  
One installation is local, self-compiled and with that version  
everything is working fine.  
I also have a system-installation and with that ruby-version i cannot  
find header files.

For example installing the gem sqlite3-ruby

`gem install sqlite3-ruby --
--with-sqlite3-include=/home/xyz/`  
(sqlite3.h is in home folder) and thats working.  
Same command with the system ruby, i get that it cannot find the  
sqlite3.h error.

According to the admin, the dev-files for ruby are installed (maybe  
wrong?).

thanks skully

---

<div class="post-metadata">

**Author:** ![mike343](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/58f4c7/32.png) [@mike343](https://www.ruby-forum.com/u/mike343)\
**Post date:** [April 21, 2010, 4:26pm UTC](https://www.ruby-forum.com/t/cannot-find-header-files/187313/2 "2010-04-21T16:26:59Z")

</div>

Did you check a mkmf.log file under the gem path?

–  
Moru

---

<div class="post-metadata">

**Author:** ![mike343](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/58f4c7/32.png) [@mike343](https://www.ruby-forum.com/u/mike343)\
**Post date:** [April 21, 2010, 4:40pm UTC](https://www.ruby-forum.com/t/cannot-find-header-files/187313/3 "2010-04-21T16:40:32Z")

</div>

have\_header: checking for sqlite3.h… -------------------- no

not working:  
“/opt/studio/SOS11/SUNWspro/bin/cc -E -I.  
-I/opt/csw/lib/ruby/1.8/sparc-solaris2.8 -I. -I/home/ssk  
-I/opt/csw/include -D\_FILE\_OFFSET\_BITS=64 -I/opt/csw/include -xO3  
-xarch=v8 -I/opt/csw/include -KPIC conftest.c -o conftest.i”

working:  
“gcc -E -I. -I/home/ssk/ruby/lib/ruby/1.8/sparc-solaris2.10 -I.  
-I/home/ssk -D\_FILE\_OFFSET\_BITS=64 -g -O2 conftest.c -o conftest.i”

By the looks of it, it seems to use a different compiler, how can i  
change that?

---

<div class="post-metadata">

**Author:** ![mike343](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/58f4c7/32.png) [@mike343](https://www.ruby-forum.com/u/mike343)\
**Post date:** [April 21, 2010, 7:03pm UTC](https://www.ruby-forum.com/t/cannot-find-header-files/187313/4 "2010-04-21T19:03:55Z")

</div>

May there is a ‘Makefile’ in the directory,  
GEM\_HOME/gems/sqlite3-ruby-x.x.x/ext/, so you can figure out that file  
to set CC and CFLAGS for your environment.

It seems like ‘mkmf’ is using CC which used to compiling her base  
ruby. I also got similar errors last one month, so I did edit Makefile  
and make extension directly and then install gems via setup.rb

I did,

1. figure out Makefile  
$ vi sqlite3-ruby-x.x.x/ext/sqlite3\_api/Makefile

2. compile extension. go to sqlite3-ruby-x.x.x/ext/sqlite3\_api. and  
then,  
$ ruby extconf.rb (you can use --with-NAME-include or lib. this will  
work fine.)  
$ make  
$ make install

3. go to root of sqlite3-ruby. install gem directly,  
$ ruby setup.rb all --without-ext

4. all done.

but be careful. this gem will not controlled under gem system. you can  
build gem also, not use setup.rb, if you want.

my english is very poor, but I think you can very well. 🙂

–  
Moru
