无法安装旧版本的宝石" rmagick"

时间:2016-08-26 11:54:26

标签: ruby-on-rails ruby linux ruby-on-rails-3

我碰巧有一些旧的rails项目,它的rails 3.2和ruby 2.2.4。因此,安装一些宝石失败了,特别是它的rmagick -v' 2.13.2'"。

    $ gem install rmagick -v '2.13.2'
    Building native extensions.  This could take a while...
    ERROR:  Error installing rmagick:
            ERROR: Failed to build gem native extension.

        /home/user123/.rubies/ruby-2.2.4/bin/ruby -r ./siteconf20160826-3014-1j0i394.rb extconf.rb
    checking for Ruby version >= 1.8.5... yes
    checking for gcc... yes
    checking for Magick-config... yes
    checking for ImageMagick version >= 6.4.9... yes
    checking for HDRI disabled version of ImageMagick... no

    Can't install RMagick 2.13.2.
    RMagick does not work when ImageMagick is configured for High Dynamic Range Images.
    Don't use the --enable-hdri option when configuring ImageMagick.

    *** 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=/home/user123/.rubies/ruby-2.2.4/bin/$(RUBY_BASE_NAME)

    extconf failed, exit code 1

    Gem files will remain installed in /home/user123/.gem/ruby/2.2.4/gems/rmagick-2.13.2 for inspection.
    Results logged to /home/user123/.gem/ruby/2.2.4/extensions/x86_64-linux/2.2.0-static/rmagick-2.13.2/gem_make.out

我已经尝试过对图书馆" ImageMagick"安装一个没有hdri,但即便失败,因为还有其他依赖于" ImageMagick"使用hdri,因此我无法重新安装它。 通常,仅为单个rails项目重新安装库并不是一件合适的事情。

那么你会推荐我什么? 我在Arch Linux上安装了2个红宝石:

$ chruby
 * ruby-2.2.4
   ruby-2.3.1

也许我应该将它升级为更新版本?请注意,我不想破坏项目中的其他依赖项。

1 个答案:

答案 0 :(得分:0)

你可以在另一个位置安装非HDRI库,并确保首先找到它的Magick-config:

PATH="/alternative-path-you-choose/ImageMagick-6.8.9/bin-Q16:$PATH" gem install rmagick -v '2.13.2'