# Can I use rake with a different compiler

**URL:** <https://www.ruby-forum.com/t/can-i-use-rake-with-a-different-compiler/112125>\
**Category:** Rails\
**Created:** [August 15, 2007, 6:22pm UTC](https://www.ruby-forum.com/t/can-i-use-rake-with-a-different-compiler/112125 "2007-08-15T18:22:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![charlie\_caroff](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/a587f6/32.png) [@charlie\_caroff](https://www.ruby-forum.com/u/charlie_caroff)\
**Post date:** [August 15, 2007, 6:22pm UTC](https://www.ruby-forum.com/t/can-i-use-rake-with-a-different-compiler/112125/1 "2007-08-15T18:22:09Z")

</div>

Hi,

I’m trying to compile libxml-ruby under FreeBSD, and it won’t  
compile. One of the notes with the gem says I should use gcc 4.0 to  
compile – I installed gcc 4.0, but not as my native compiler, so I  
need to somehow specify my new compiler, when I install libxml-ruby.  
I’m sure there is a way to do this, but I can’t find any documentation  
for this.

Charlie

---

<div class="post-metadata">

**Author:** ![charlie\_caroff](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/a587f6/32.png) [@charlie\_caroff](https://www.ruby-forum.com/u/charlie_caroff)\
**Post date:** [August 15, 2007, 6:31pm UTC](https://www.ruby-forum.com/t/can-i-use-rake-with-a-different-compiler/112125/2 "2007-08-15T18:31:10Z")

</div>

On Wed, 15 Aug 2007, charlie caroff wrote:

> Hi,
> 
> I’m trying to compile libxml-ruby under FreeBSD, and it won’t  
> compile. One of the notes with the gem says I should use gcc 4.0 to  
> compile – I installed gcc 4.0, but not as my native compiler, so I  
> need to somehow specify my new compiler, when I install libxml-ruby.  
> I’m sure there is a way to do this, but I can’t find any documentation  
> for this.

Have you tried (sh syntax): CC=/my/compiler/bin/gcc ; export CC,  
or (csh syntax): setenv CC /my/compiler/bin/gcc  
to see if that gets picked up?

> Charlie

```
    Hugh
```

---

<div class="post-metadata">

**Author:** ![charlie\_caroff](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/a587f6/32.png) [@charlie\_caroff](https://www.ruby-forum.com/u/charlie_caroff)\
**Post date:** [August 15, 2007, 7:38pm UTC](https://www.ruby-forum.com/t/can-i-use-rake-with-a-different-compiler/112125/3 "2007-08-15T19:38:17Z")

</div>

That works, thanks. Still not compiling, though. I’m getting this  
error when I try to install libxml-ruby from gems:

gcc -I. -I. -I/usr/local/lib/ruby/1.8/i386-freebsd6.2 -I. -I/usr/local/  
include/libxml2 -DRUBY\_EXTCONF\_H=“extconf.h” -fPIC -g -O2 -Wall -I. -  
I/usr/local/lib/ruby/1.8/i386-freebsd6.2 -I. -I/usr/local/include/  
libxml2 -c ruby\_xml\_xpath.c  
In file included from /usr/local/include/libxml2/libxml/parser.h:796,  
from libxml.h:19,  
from ruby\_xml\_xpath.c:5:  
/usr/local/include/libxml2/libxml/encoding.h:28:19: iconv.h: No such  
file or directory  
In file included from /usr/local/include/libxml2/libxml/parser.h:796,  
from libxml.h:19,  
from ruby\_xml\_xpath.c:5:  
/usr/local/include/libxml2/libxml/encoding.h:135: error: syntax error  
before “ifdef”  
/usr/local/include/libxml2/libxml/encoding.h:139: warning: no  
semicolon at end of struct or union  
\*\*\* Error code 1

Stop in /usr/local/lib/ruby/gems/1.8/gems/libxml-ruby-0.3.8.4/ext/xml.

Gem files will remain installed in /usr/local/lib/ruby/gems/1.8/gems/  
libxml-ruby-0.3.8.4 for inspection.  
Results logged to /usr/local/lib/ruby/gems/1.8/gems/libxml-  
ruby-0.3.8.4/ext/xml/gem\_make.out

################

I have iconv installed from FreeBSD ports – i’m stumped
