# How to install ruby-gd

**URL:** <https://www.ruby-forum.com/t/how-to-install-ruby-gd/109659>\
**Category:** Ruby\
**Created:** [July 17, 2007, 5:08pm UTC](https://www.ruby-forum.com/t/how-to-install-ruby-gd/109659 "2007-07-17T17:08:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![w\_wg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/7ba0ec/32.png) [@w\_wg](https://www.ruby-forum.com/u/w_wg)\
**Post date:** [July 17, 2007, 5:08pm UTC](https://www.ruby-forum.com/t/how-to-install-ruby-gd/109659/1 "2007-07-17T17:08:35Z")

</div>

Hi,

I installed the ruby-gd like so:

gem install ruby-gd

[root@rj-bsd /var/www/rjinfo.com]# gem install ruby-gd  
Attempting local installation of ‘ruby-gd’  
Local gem file not found: ruby-gd\*.gem  
Attempting remote installation of ‘ruby-gd’  
Building native extensions. This could take a while…  
\*\*\* extconf.rb failed \*\*\*  
Could not create Makefile due to some reason, probably lack of  
necessary libraries and/or headers. Check the mkmf.log file for more  
details. You may need configuration options.

Provided configuration options:  
–with-opt-dir  
–without-opt-dir  
–with-opt-include  
–without-opt-include=${opt-dir}/include  
–with-opt-lib  
–without-opt-lib=${opt-dir}/lib  
–with-make-prog  
–without-make-prog  
–srcdir=.  
–curdir  
–ruby=/usr/local/bin/ruby18  
–with-gd-dir  
–without-gd-dir  
–with-gd-include  
–without-gd-include=${gd-dir}/include  
–with-gd-lib  
–without-gd-lib=${gd-dir}/lib  
–with-xpm  
–without-xpm  
–with-jpeg  
–without-jpeg  
–with-ttf  
–without-ttf  
–with-xpm  
–without-xpm  
–with-freetype  
–without-freetype  
–with-zlib  
–without-zlib  
–with-pnglib  
–without-pnglib  
–with-gdlib  
–without-gdlib  
ERROR: While executing gem … (RuntimeError)  
ERROR: Failed to build gem native extension.  
Gem files will remain installed in  
/usr/local/lib/ruby/gems/1.8/gems/ruby-gd-0.7.4 for inspection.  
ruby extconf.rb install ruby-gd\nchecking for main() in -lz… yes  
checking for main() in -lpng… yes  
checking for gdImagePng() in -lgd… no

Results logged to  
/usr/local/lib/ruby/gems/1.8/gems/ruby-gd-0.7.4/gem\_make.out

Please help me, thank you.

---

<div class="post-metadata">

**Author:** ![w\_wg](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/7ba0ec/32.png) [@w\_wg](https://www.ruby-forum.com/u/w_wg)\
**Post date:** [July 17, 2007, 5:58pm UTC](https://www.ruby-forum.com/t/how-to-install-ruby-gd/109659/2 "2007-07-17T17:58:42Z")

</div>

> Could not create Makefile due to some reason, probably lack of  
> –with-make-prog  
> –with-xpm  
> –without-zlib  
> checking for gdImagePng() in -lgd… no  
> WenGe Wang  
> Dear WenGe,

the gd library complains that you did not install support for the  
PNG graphics format.  
If you didn’t, check out this page for binaries or source code:

[libpng Home Page](http://www.libpng.org/pub/png/libpng.html) .

If you did, there is this in the installation wiki of gd:

[http://www.libgd.org/FAQ#gd\_keeps\_saying\_it\_can.27t\_find\_png\_or\_jpeg\_support.\_I\_did\_install\_libpng\_and\_libjpeg.\_What\_am\_I\_missing.3F](http://www.libgd.org/FAQ#gd_keeps_saying_it_can.27t_find_png_or_jpeg_support._I_did_install_libpng_and_libjpeg._What_am_I_missing.3F)

Alternatively, you could call the gem install setup process with  
the flag --without-pnglib, if you are sure that you don’t want PNG  
graphics support.

Best regards,

Axel
