Rails:安装 rmagick 时出错 - 错误:无法构建 gem 本机扩展 [英] Rails: Error installing rmagick - ERROR: Failed to build gem native extension

查看:24
本文介绍了Rails:安装 rmagick 时出错 - 错误:无法构建 gem 本机扩展的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在本地机器上运行一个项目.我在 Mac OS 系统上安装了 Ruby 和 Rails.它工作正常.我可以创建一个新项目并且可以正常运行它而不会出现任何错误,但是当我尝试运行现有项目时,它说我们必须bundle install.当我运行该命令时,出现以下错误:

I am trying to run one project on my local machine. I installed Ruby and Rails on my Mac OS system. It is working properly. I can create a new project and can run it properly without any error, but when I try to run the existing project it says that we have to bundle install. When I run that command I get the following error:

"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."

当我运行 gem install rmagick -v '2.13.2' 时,它给了我以下错误:

When I run gem install rmagick -v '2.13.2' it gives me the following error:

ERROR:  Error installing rmagick:
ERROR: Failed to build gem native extension.

/usr/local/rvm/rubies/ruby-1.9.3-p392/bin/ruby extconf.rb
checking for Ruby version >= 1.8.5... yes
checking for gcc-4.2... yes
checking for Magick-config... no
Can't install RMagick 2.13.2. Can't find Magick-config in /usr/local/rvm/gems/ruby-1.9.3-p392/bin:/usr/local/rvm/gems/ruby-1.9.3-p392@global/bin:/usr/local/rvm/rubies/ruby-1.9.3-p392/bin:/usr/local/rvm/gems/ruby-1.9.3-p392/bin:/usr/local/rvm/gems/ruby-1.9.3-p392@global/bin:/usr/local/rvm/rubies/ruby-1.9.3-p392/bin:/usr/local/rvm/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/sm/bin:/opt/sm/pkg/active/bin:/opt/sm/pkg/active/sbin

*** 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/rvm/rubies/ruby-1.9.3-p392/bin/ruby


Gem files will remain installed in /usr/local/rvm/gems/ruby-1.9.3-p392/gems/rmagick-2.13.2 for inspection.
Results logged to /usr/local/rvm/gems/ruby-1.9.3-p392/gems/rmagick-2.13.2/ext/RMagick/gem_make.out

我已经搜索过,但没有在任何地方找到答案.

I have searched and did not find an answer anywhere.

推荐答案

对于 Ubuntu,我使用了 ff.基于此链接:

For Ubuntu, I used the ff. based on this link:

$ sudo apt-get install libmagick++-dev

这篇关于Rails:安装 rmagick 时出错 - 错误:无法构建 gem 本机扩展的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆