# Hpricot on my Solaris x-86 box. cc bad , gcc good

**URL:** <https://www.ruby-forum.com/t/hpricot-on-my-solaris-x-86-box-cc-bad-gcc-good/121243>\
**Category:** Ruby\
**Created:** [November 26, 2007, 12:47am UTC](https://www.ruby-forum.com/t/hpricot-on-my-solaris-x-86-box-cc-bad-gcc-good/121243 "2007-11-26T00:47:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![HoboHoward](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/6f9a4e/32.png) [@HoboHoward](https://www.ruby-forum.com/u/HoboHoward)\
**Post date:** [November 26, 2007, 12:47am UTC](https://www.ruby-forum.com/t/hpricot-on-my-solaris-x-86-box-cc-bad-gcc-good/121243/1 "2007-11-26T00:47:40Z")

</div>

Dear List,

I want to install hpricot on my Solaris x-86 box.

The makefile generated by the hpricot-installer wants me to use the  
‘cc’ c-compiler.

I dont have ‘cc’.

I have ‘gcc’.

Is it possible for me to force the hpricot-installer to use my copy of  
gcc ??

Here is a screen dump of my installation attempt:

14 bash-14:31:27-sol:/opt/csw/lib/ruby/gems/1.8/cache root#  
14 bash-14:31:28-sol:/opt/csw/lib/ruby/gems/1.8/cache root# pwd  
/opt/csw/lib/ruby/gems/1.8/cache  
15 bash-14:31:30-sol:/opt/csw/lib/ruby/gems/1.8/cache root#  
15 bash-14:31:30-sol:/opt/csw/lib/ruby/gems/1.8/cache root#  
15 bash-14:31:30-sol:/opt/csw/lib/ruby/gems/1.8/cache root#  
15 bash-14:31:31-sol:/opt/csw/lib/ruby/gems/1.8/cache root# ls  
./ actionpack-1.13.3.gem  
activerecord-1.15.3.gem activesupport-1.4.4.gem  
…/ actionpack-1.13.6.gem  
activerecord-1.15.6.gem rails-1.2.3.gem  
actionmailer-1.3.3.gem actionwebservice-1.2.3.gem  
activesupport-1.4.2.gem rake-0.7.3.gem  
16 bash-14:31:32-sol:/opt/csw/lib/ruby/gems/1.8/cache root#  
16 bash-14:31:32-sol:/opt/csw/lib/ruby/gems/1.8/cache root#  
16 bash-14:31:33-sol:/opt/csw/lib/ruby/gems/1.8/cache root#  
16 bash-14:31:33-sol:/opt/csw/lib/ruby/gems/1.8/cache root# gem  
install hpricot  
Updating metadata for 11 gems from [http://gems.rubyforge.org](http://gems.rubyforge.org)  
…  
complete  
Building native extensions. This could take a while…  
ERROR: Error installing hpricot:  
ERROR: Failed to build gem native extension.

/opt/csw/bin/ruby extconf.rb install hpricot  
checking for main() in -lc… no  
creating Makefile

make  
cc -I. -I. -I/opt/csw/lib/ruby/1.8/i386-solaris2.8 -I. -I/opt/csw/  
include -I/opt/csw/include -KPIC -xO3 -xarch=386 -xspace -xildoff -I/  
opt/csw/include -I/opt/csw/include -KPIC -c hpricot\_scan.c  
sh: cc: not found  
\*\*\* Error code 1  
make: Fatal error: Command failed for target `hpricot\_scan.o’

Gem files will remain installed in /opt/csw/lib/ruby/gems/1.8/gems/  
hpricot-0.6 for inspection.  
Results logged to /opt/csw/lib/ruby/gems/1.8/gems/hpricot-0.6/ext/  
hpricot\_scan/gem\_make.out  
17 bash-14:32:10-sol:/opt/csw/lib/ruby/gems/1.8/cache root#  
17 bash-14:32:52-sol:/opt/csw/lib/ruby/gems/1.8/cache root#

17 bash-14:32:52-sol:/opt/csw/lib/ruby/gems/1.8/cache root#  
17 bash-14:32:53-sol:/opt/csw/lib/ruby/gems/1.8/cache root# which gcc  
/opt/csw/gcc3/bin/gcc  
18 bash-14:33:17-sol:/opt/csw/lib/ruby/gems/1.8/cache root#  
18 bash-14:33:17-sol:/opt/csw/lib/ruby/gems/1.8/cache root#

18 bash-14:33:17-sol:/opt/csw/lib/ruby/gems/1.8/cache root#  
18 bash-14:33:17-sol:/opt/csw/lib/ruby/gems/1.8/cache root# uname -a  
SunOS sol 5.10 Generic\_118855-14 i86pc i386 i86pc  
19 bash-14:45:24-sol:/opt/csw/lib/ruby/gems/1.8/cache root#  
19 bash-14:45:25-sol:/opt/csw/lib/ruby/gems/1.8/cache root#

Is it possible for me to force the hpricot-installer to use my copy of  
gcc ??

–hh

---

<div class="post-metadata">

**Author:** ![HoboHoward](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/6f9a4e/32.png) [@HoboHoward](https://www.ruby-forum.com/u/HoboHoward)\
**Post date:** [November 26, 2007, 11:38pm UTC](https://www.ruby-forum.com/t/hpricot-on-my-solaris-x-86-box-cc-bad-gcc-good/121243/2 "2007-11-26T23:38:48Z")

</div>

HoboHoward [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) writes:

> Is it possible for me to force the hpricot-installer to use my copy of  
> gcc ??

It really wants to use the compiler that Ruby was built with.

[~]0% ruby -rrbconfig -e ‘p Config::CONFIG[“CC”]’  
“cc”

The S. compiler suite can be downloaded for free, but if you are  
really attached to gcc then you should build Ruby yourself instead of  
using blastwave.

Steve

---

<div class="post-metadata">

**Author:** ![HoboHoward](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/6f9a4e/32.png) [@HoboHoward](https://www.ruby-forum.com/u/HoboHoward)\
**Post date:** [November 28, 2007, 8:23am UTC](https://www.ruby-forum.com/t/hpricot-on-my-solaris-x-86-box-cc-bad-gcc-good/121243/3 "2007-11-28T08:23:53Z")

</div>

I fixed my hpricot problems on my solaris x-86 box.

I downloaded a couple of large files from [sun.com](http://sun.com) after registration:

-rwx------ 1 maco staff 243701577 Nov 27 02:54 SunStudio12ml-  
solaris-x86-200709-ii.tar.bz2  
-rwx------ 1 maco staff 272616587 Nov 27 02:58  
SunStudio12mlPrepSys-solaris-x86-200709.tar.bz2

I unpacked them:

tar jxf SunStudio12ml-solaris-x86-200709-ii.tar.bz2  
tar jxf SunStudio12mlPrepSys-solaris-x86-200709.tar.bz2

I found:

85 bash-23:22:00-sol:~/sun\_studio12 $  
85 bash-23:22:00-sol:~/sun\_studio12 $  
85 bash-23:22:02-sol:~/sun\_studio12 $ ll  
total 12  
drwxr-xr-x 5 maco staff 512 Nov 27 08:59 ./  
drwxr-xr-x 18 maco root 1024 Nov 27 22:37 …/  
lrwxrwxrwx 1 maco staff 26 Nov 27 08:56  
SS12\_README\_FIRST → SUNWspro/SS12\_README\_FIRST/  
drwxr-xr-x 4 maco staff 512 Sep 23 13:15  
SS12\_prep\_system/  
drwxr-xr-x 15 maco staff 512 Sep 23 23:37 SUNWspro/  
drwxr-xr-x 11 maco staff 1024 Sep 23 01:27 netbeans-5.5.1/  
86 bash-23:22:08-sol:~/sun\_studio12 $  
86 bash-23:22:08-sol:~/sun\_studio12 $

I ran shell commands:

cd SS12\_prep\_system  
su  
./prepare\_system -s netbeans,patches

I found cc here: ~/sun\_studio12/SUNWspro/bin/cc

I added  
~/sun\_studio12/SUNWspro/bin to my PATH.

I ran shell command:

44 bash-22:37:49-sol:~/software/hpricot $ gem install hpricot  
Updating metadata for 45 gems from [http://gems.rubyforge.org](http://gems.rubyforge.org)  
…  
complete  
Building native extensions. This could take a while…  
Successfully installed hpricot-0.6  
1 gem installed  
Installing ri documentation for hpricot-0.6…  
Installing RDoc documentation for hpricot-0.6…

I was happy!  
(Thanks Steve!!)  
–hh
