【问题标题】:Error occurred while installing rmagick安装 rmagick 时出错
【发布时间】:2012-10-07 08:05:32
【问题描述】:

尝试在 Windows Server 2008 R2 上安装 Redmine 时出现以下错误。

C:\Ruby\Apps\Redmine>rake db:migrate
←[31mCould not find gem 'rmagick (>= 2.0.0) x86-mingw32' in the gems available o
n this machine.←[0m
←[33mRun `bundle install` to install missing gems.←[0m

C:\Ruby\Apps\Redmine>bundle install
Fetching gem metadata from http://rubygems.org/.......
Using rake (0.9.2.2)
Using i18n (0.6.1)
Using multi_json (1.3.6)
Using activesupport (3.2.8)
Using builder (3.0.0)
Using activemodel (3.2.8)
Using erubis (2.7.0)
Using journey (1.0.4)
Using rack (1.4.1)
Using rack-cache (1.2)
Using rack-test (0.6.2)
Using hike (1.2.1)
Using tilt (1.3.3)
Using sprockets (2.1.3)
Using actionpack (3.2.8)
Using mime-types (1.19)
Using polyglot (0.3.3)
Using treetop (1.4.10)
Using mail (2.4.4)
Using actionmailer (3.2.8)
Using arel (3.0.2)
Using tzinfo (0.3.33)
Using activerecord (3.2.8)
Using activeresource (3.2.8)
Using bundler (1.2.1)
Using coderay (1.0.7)
Using fastercsv (1.5.5)
Using rack-ssl (1.3.2)
Using json (1.7.5)
Using rdoc (3.12)
Using thor (0.16.0)
Using railties (3.2.8)
Using jquery-rails (2.0.3)
Using metaclass (0.0.1)
Using mocha (0.12.3)
Using mysql (2.8.1)
Using net-ldap (0.3.1)
Using pg (0.14.1)
Using ruby-openid (2.1.8)
Using rack-openid (1.3.1)
Using rails (3.2.8)
Installing rmagick (2.13.1) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension
.

        C:/Ruby187/bin/ruby.exe extconf.rb
checking for Ruby version >= 1.8.5... yes
Invalid drive specification.
Unable to get ImageMagick version
*** 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=C:/Ruby187/bin/ruby


Gem files will remain installed in C:/Ruby187/lib/ruby/gems/1.8/gems/rmagick-2.1
3.1 for inspection.
Results logged to C:/Ruby187/lib/ruby/gems/1.8/gems/rmagick-2.13.1/ext/RMagick/g
em_make.out
An error occurred while installing rmagick (2.13.1), and Bundler cannot continue
.
Make sure that `gem install rmagick -v '2.13.1'` succeeds before bundling.

在尝试使用此 gem install rmagick -v '2.13.1' 安装 rmagick 时

我收到此错误...

C:\Ruby\Apps\Redmine>gem install rmagick -v 2.13.1
Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
ERROR:  Error installing rmagick:
        ERROR: Failed to build gem native extension.

        C:/Ruby187/bin/ruby.exe extconf.rb
checking for Ruby version >= 1.8.5... yes
Invalid drive specification.
Unable to get ImageMagick version
*** 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=C:/Ruby187/bin/ruby


Gem files will remain installed in C:/Ruby187/lib/ruby/gems/1.8/gems/rmagick-2.1
3.1 for inspection.
Results logged to C:/Ruby187/lib/ruby/gems/1.8/gems/rmagick-2.13.1/ext/RMagick/g
em_make.out

【问题讨论】:

  • 您的路径中是否安装了 devkit?
  • 是的,devkit 已安装。但不知道它的路径?请解释一下。
  • 在您的命令提示符set PATH=%DEVKIT_HOME%\bin;%PATH% 上执行操作,然后从同一终端运行gem install rmagick。这是假设您的 DEVKIT_HOME 变量解析为您的 devkit 安装目录
  • 我的 devkit 路径是 c:\Ruby187\devkit,请指教。
  • 所以只需将它添加到您的路径即set PATH=c:\ruby187\devkit\bin;%PATH% 然后从同一终端运行 gem install rmagick

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


【解决方案1】:

试试这个:

apt-get install libmagickwand-dev
gem install rmagick

【讨论】:

  • 从 cmets 看来,它似乎对其他人有用。请注意,我已经完全切换到不同的解决方案,所以不能说它是否适合我!但由于它对其他人有用,我接受这个作为答案。
【解决方案2】:

您是否先安装了 Imagemagick? http://www.imagemagick.org

其实见:Won't Let Me Install Gem in Ruby Prompt

【讨论】:

  • 是的,还是不行。我注意到的一件事是 ROR 很烂,没有任何适当的文档,即使在过去两天花费了无数小时之后,它还是会引发一个又一个错误,最后我决定使用 Bitnami 安装程序,而不是按照指令。
【解决方案3】:

sudo apt-get install libmagickcore-dev libmagickwand-dev

在运行 bundle install 之后

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-01-26
    • 2012-12-06
    • 2018-05-29
    • 1970-01-01
    • 1970-01-01
    • 2016-12-25
    相关资源
    最近更新 更多