rmagick-temp / rmagick

An interface to the ImageMagick and GraphicsMagick image processing libraries.
http://rmagick.rubyforge.org/
MIT License
790 stars 102 forks source link

set prefix to empty string if config_string(prefix) is nill #101

Closed trbrink closed 10 years ago

trbrink commented 10 years ago

I get the following error when building Rmagick-2.13.2 on Centos 6.4 using Ruby 2.1:

 Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
     /usr/bin/ruby extconf.rb 
 checking for Ruby version >= 1.8.5... yes
 checking for gcc... yes
 checking for Magick-config... yes
 *** 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}/lib64
         --with-make-prog
         --without-make-prog
         --srcdir=.
         --curdir
         --ruby=/usr/bin/ruby
 extconf.rb:83:in `check_partial_imagemagick_versions': undefined method `+' for false:FalseClass (NoMethodError)
         from extconf.rb:140:in `<main>'
 extconf failed, exit code 1
 Gem files will remain installed in /var/www/purchase.stcnet.com/shared/bundle/ruby/gems/rmagick-2.13.2 for inspection.
 Results logged to /var/www/purchase.stcnet.com/shared/bundle/ruby/extensions/x86_64-linux/2.1.0/rmagick-2.13.2/gem_make.out
 An error occurred while installing rmagick (2.13.2), and Bundler cannot
 continue.
 Make sure that `gem install rmagick -v '2.13.2'` succeeds before bundling.

This pull request sets the prefix variable defined in the check_partial_imagemagick_versions method to "" if config_string("prefix") returns false. For me this fixed the build issue.

The same fix was implemented here.

trbrink commented 10 years ago

Wow I can't believe I missed https://github.com/rmagick/rmagick/pull/71.