用gem install ruby-gd 都會跳出錯誤訊息
Fetching: ruby-gd-0.8.0.gem (100%)
Building native extensions. This could take a while...
ERROR: Error installing ruby-gd:
ERROR: Failed to build gem native extension.
/usr/local/Cellar/ruby/2.0.0-p0/bin/ruby extconf.rb
checking for main() in -lz... yes
checking for main() in -lpng... yes
checking for gdImagePng() in -lgd... no
*** 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/Cellar/ruby/2.0.0-p0/bin/ruby
--with-gd-dir
--without-gd-dir
--with-gd-include
--without-gd-include=${gd-dir}/include
--with-gd-lib
--without-gd-lib=${gd-dir}/
--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
Gem files will remain installed in /usr/local/Cellar/ruby/2.0.0-p0/lib/ruby/gems/2.0.0/gems/ruby-gd-0.8.0 for inspection.
Results logged to /usr/local/Cellar/ruby/2.0.0-p0/lib/ruby/gems/2.0.0/gems/ruby-gd-0.8.0/./gem_make.out
所以改去網站用抓的 然後手動
$ tar xfvz ruby-GD-0.7.4.tar.gz
$ cd ruby-GD-0.7.4
$ ruby extconf.rb --with-ttf --with-freetype
$ make
$ sudo make install
沒有留言:
張貼留言