简体   繁体   English

在Ubuntu 14.04上安装rmagick gem

[英]Installing rmagick gem on ubuntu 14.04

I'm trying to deploy an app on OpsWorks, but there are problems with installing rmagick gem. 我正在尝试在OpsWorks上部署应用程序,但是安装rmagick gem会出现问题。 I have the following OS packages: 我有以下操作系统软件包:

libmagickwand-dev imagemagick libmagickcore-dev libmagickwand-dev imagemagick libmagickcore-dev

Below is the log file with errors during deployment: 以下是在部署过程中出现错误的日志文件:

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

/usr/local/bin/ruby extconf.rb
checking for Ruby version >= 1.8.5... yes
checking for gcc... yes
checking for Magick-config... no
Can't install RMagick 0.0.0. Can't find Magick-config in /usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games

*** 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/ruby

extconf failed, exit code 1

Gem files will remain installed in /home/deploy/.bundler/myapp/ruby/2.1.0/gems/rmagick-2.13.3 for inspection.
Results logged to /home/deploy/.bundler/myapp/ruby/2.1.0/extensions/x86_64-linux/2.1.0/rmagick-2.13.3/gem_make.out
An error occurred while installing rmagick (2.13.3), and Bundler cannot
continue.
Make sure that `gem install rmagick -v '2.13.3'` succeeds before bundling.
STDERR:
---- End output of sudo su - deploy -c 'cd /srv/www/myapp/releases/20140929182350 && /usr/local/bin/bundle install --path /home/deploy/.bundler/myapp --without=test development' 2>&1 ----
Ran sudo su - deploy -c 'cd /srv/www/myapp/releases/20140929182350 && /usr/local/bin/bundle install --path /home/deploy/.bundler/myapp --without=test development' 2>&1 returned 5
[2014-09-29T18:24:08+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)

在您的shell中,运行以下命令:

apt-get install libmagickwand-dev

I had the same problem after upgrading ubuntu to 15.05, some how the Magick-config file is no longer in my PATH. 在将ubuntu升级到15.05之后,我遇到了同样的问题,这说明Magick-config文件不再存在于我的PATH中。 To fix this I first found the location of Magick-config 为了解决这个问题,我首先找到了Magick-config的位置

sudo find / -name "Magick-config"

which was /usr/lib/x86_64-linux-gnu/ImageMagick-6.8.9/bin-Q16/Magick-config then I added it to the path. 这是/usr/lib/x86_64-linux-gnu/ImageMagick-6.8.9/bin-Q16/Magick-config然后将其添加到路径中。 Bundle succeeded afterwards. 之后捆绑成功。

sudo apt-get install libmagickwand5 libmagickwand-dev
gem install rmagick -v 2.13.3

Install Imagemagick-dev libraries 安装Imagemagick-dev库

Ubuntu systems: sudo apt-get install libmagickwand-dev Ubuntu系统: sudo apt-get install libmagickwand-dev

RHEL systems: yum install ImageMagick-devel RHEL系统: yum install ImageMagick-devel

Mac: brew install imagemagick Mac: brew install imagemagick

In Ubuntu 14.04 I also needed to install the libgmp-dev library to get working the newer rmagick 2.15.4 version: 在Ubuntu 14.04中,我还需要安装libgmp-dev库才能使用更新的rmagick 2.15.4版本:

sudo apt-get install libgmp-dev

Hope this helps! 希望这可以帮助!

要永久修复它,我们可以这样做:

ln -s /usr/lib/x86_64-linux-gnu/ImageMagick-6.8.9/bin-Q16/Magick-config /usr/bin/Magick-config

First of all we need to search configuration 首先我们需要搜索配置

sudo find / -name "Magick-config"

You will get output something like this: 您将获得如下输出:

/usr/lib/x86_64-linux-gnu/ImageMagick-6.8.9/bin-Q16/Magick-config

Now you just need to setup bin location in your environment by using this: 现在,您只需要使用以下方法在您的环境中设置垃圾箱位置:

PATH=$PATH:/usr/lib/x86_64-linux-gnu/ImageMagick-6.8.9/bin-Q16/

Don't forget to remove Magick-config from end of line. 不要忘记从行尾删除Magick-config。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM