首页 文章

运行Rails 3.2应用程序时出现Rmagick错误

提问于
浏览
1

我正在开发一个旧项目,它有Ruby版本1.9.3p和Rails 3.2.13

这是我的Gemfile:

gem 'rails', '3.2.13'
gem 'mysql2', '~> 0.4.1', :group => [:production, :staging]
gem "paperclip", "~> 2.3"
gem "rmagick", "~> 2.13.1", :require => 'RMagick'

当我运行bundle install时,我收到一个错误:

安装rmagick(2.13.2)时发生错误,Bundler无法继续 . 在捆绑之前确保gem install rmagick -v'2.13.2'成功 .

当我运行上面的命令时,我收到错误:

abcuser @ myvm:〜/ Desktop / report_master $ gem install rmagick -v'2.13.2'构建原生扩展 . 这可能需要一段时间...错误:安装rmagick时出错:错误:无法构建gem原生扩展 . 当前目录:/home/abcuser/.rvm/gems/ruby-1.9.3-p551@proj/gems/rmagick-2.13.2/ext/RMagick
/home/abcuser/.rvm/rubies/ruby-1.9.3-p551/bin/ruby -r ./siteconf20160603-8257-drbei5.rb extconf.rb检查Ruby版本= 1.8.5 ...是检查gcc ...是检查Magick-config ...否无法安装RMagick 2.13.2 . 在/home/abcuser/.rvm/gems/ruby-1.9.3-p551@proj/bin:/home/abcuser/.rvm/gems/ruby-1.9.3-p551@global/找不到Magick-config斌:/home/abcuser/.rvm/rubies/ruby-1.9.3-p551/bin:/home/abcuser/.rvm/bin:在/ usr / local / sbin中:在/ usr / local / bin目录:/ usr / sbin目录:/ usr / bin:/ sbin:/ bin:/ usr / games:/ usr / local / games * extconf.rb failed *由于某些原因无法创建Makefile,可能缺少必要的库和/或头文件 . 检查mkmf.log文件以获取更多详细信息 . 您可能需要配置选项 . 提供的配置选项: - with-opt-dir --without-opt-dir --with-opt-include --without-opt-include = $
/ include --with-opt-lib - without-opt-lib = $ / lib --with-make-prog --without-make-prog --srcdir = . --curdir --ruby = / home / abcuser / .rvm / rubies / ruby-1.9.3-p551 / bin / ruby要查看此扩展无法编译的原因,请查看mkmf.log,可在此处找到:/ home/abcuser/.rvm/gems/ruby-1.9.3-p551@proj/extensions/x86-linux/1.9.1/rmagick-2.13.2/mkmf.log extconf失败,退出代码1 Gem文件将保持安装状态/home/abcuser/.rvm/gems/ruby-1.9.3-p551@proj/gems/rmagick-2.13.2进行检查 . 结果记录到/home/abcuser/.rvm/gems/ruby-1.9.3-p551@proj/extensions/x86-linux/1.9.1/rmagick-2.13.2/gem_make.out

请帮我解决这个错误 .

2 回答

  • 3

    错误:安装rmagick时出错:错误:无法构建gem原生扩展 .

    这可能是因为您没有安装 node.js

    curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
    sudo apt-get install -y nodejs
    

    或者因为,您没有安装RMagick:

    sudo apt-get install imagemagick libmagickwand-dev
    
  • 2

    只是一个小小的建议:关注ImageMagick安全问题 . know more

相关问题