9

Ruby 1.9.2 と Rails 3.0.3 を使用しました。rmagick gem をインストールしようとしてbundle installいますが、実行すると次のようなエラーが表示されます。

Installing rmagick (2.12.1) with native extensions c:/Ruby192/lib/ruby/site_ruby
/1.9.1/rubygems/installer.rb:529:in `rescue in block in build_extensions': ERROR
: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)

       c:/Ruby192/bin/ruby.exe extconf.rb
checking for Ruby version >= 1.8.5... yes
checking for stdint.h... *** 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:/Ruby192/bin/ruby
c:/Ruby192/lib/ruby/1.9.1/mkmf.rb:368:in `try_do': The complier failed to genera
te an executable file. (RuntimeError)
You have to install development tools first.
       from c:/Ruby192/lib/ruby/1.9.1/mkmf.rb:452:in `try_cpp'
       from c:/Ruby192/lib/ruby/1.9.1/mkmf.rb:834:in `block in have_header'
       from c:/Ruby192/lib/ruby/1.9.1/mkmf.rb:693:in `block in checking_for'
       from c:/Ruby192/lib/ruby/1.9.1/mkmf.rb:280:in `block (2 levels) in postp
one'
       from c:/Ruby192/lib/ruby/1.9.1/mkmf.rb:254:in `open'
       from c:/Ruby192/lib/ruby/1.9.1/mkmf.rb:280:in `block in postpone'
       from c:/Ruby192/lib/ruby/1.9.1/mkmf.rb:254:in `open'
       from c:/Ruby192/lib/ruby/1.9.1/mkmf.rb:276:in `postpone'
       from c:/Ruby192/lib/ruby/1.9.1/mkmf.rb:692:in `checking_for'
       from c:/Ruby192/lib/ruby/1.9.1/mkmf.rb:833:in `have_header'
       from extconf.rb:171:in `<main>'


Gem files will remain installed in c:/Ruby192/lib/ruby/gems/1.9.1/gems/rmagick-2
.12.1 for inspection.
Results logged to c:/Ruby192/lib/ruby/gems/1.9.1/gems/rmagick-2.12.1/ext/RMagick
/gem_make.out
       from c:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:507:in `b
lock in build_extensions'
       from c:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:482:in `e
ach'
       from c:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:482:in `b
uild_extensions'
       from c:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:156:in `i
nstall'
       from c:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/sour
ce.rb:96:in `install'
       from c:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/inst
aller.rb:55:in `block in run'
       from c:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/spec
_set.rb:12:in `block in each'
       from c:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/spec
_set.rb:12:in `each'
       from c:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/spec
_set.rb:12:in `each'
       from c:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/inst
aller.rb:44:in `run'
       from c:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/inst
aller.rb:8:in `install'
       from c:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/cli.
rb:226:in `install'
       from c:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/vend
or/thor/task.rb:22:in `run'
       from c:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/vend
or/thor/invocation.rb:118:in `invoke_task'
       from c:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/vend
or/thor.rb:246:in `dispatch'
       from c:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/vend
or/thor/base.rb:389:in `start'
       from c:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/bin/bundle:13:in
`<top (required)>'
       from c:/Ruby192/bin/bundle:19:in `load'
       from c:/Ruby192/bin/bundle:19:in `<main>'

http://rubyinstaller.org/downloads/から開発キットと最新バージョンの ImageMagick を使用してRuby をインストールしました。rmagick 構成 (lib および include ディレクトリ) を設定しようとしましたが、それでも同じエラーが発生します

助けはありますか?問題を解決するための考えはありますか?

4

5 に答える 5

15

前提条件:
Ruby > 1.8.6
DevKit (任意のバージョン)
その他の ImageMagick のインストールまたは PATH エントリはありません

ステップ 1: ImageMagick のインストール:

ImageMagick をダウンロード: http://imagemagick.spd.co.il/binaries/ImageMagick-6.8.0-3-Q16-windows-dll.exe

ImageMagick をインストールします。
*重要: インストール パスにスペースを含めないでください。
「C:\ImageMagick」を選択するのが理想的です</p>

以下のオプションを必ず選択してください。

パス システムにアプリケーション ディレクトリを追加する
C および C++ 用の開発ヘッダーとライブラリをインストールする

ステップ 2: rmagick のインストール:

次のコマンドを使用して rmagick gem をインストールします。

gem install rmagick --platform=ruby -- --with-opt-lib=c:/ImageMagick/lib --with-opt-include=c:/ImageMagick/include

経由-

http://shoobm.wordpress.com/2013/01/03/installing-rmagick-gem-on-windows-7/

于 2013-01-03T17:40:08.793 に答える
0

RubyInstaller グループのこのスレッドを参照してください。このスレッドは、インストール方法を説明するこのブログ投稿を見つけることができるチュートリアル ページを示しています。

于 2011-02-02T16:23:32.210 に答える
0

rmagick -win32 gem を使えば別途 ImageMagick は必要ありません。これはバンドルされています。

ご覧ください: http://rmagick.rubyforge.org/install-faq.html#win

于 2011-02-02T10:40:14.360 に答える
0

まず、パス環境変数をクリアします。(これは人々がスキップすることが多い主要なステップですが、非常に重要です)。これが、直面しているエラーの主な理由です。

次に、ここから Rails インストーラー (2.0.0) をインストールします: http://railsinstaller.org/en

Ruby、Rails、その他必要なものすべてをセットアップします。これにより、環境パス変数も設定されます。

次に imagemagick 6.7.9.9 以下をインストールし、インストール中に C ヘッダーを含めるオプションをチェックします。Railsインストーラーフォルダー内にインストールしてください。

次に、これをコマンドプロンプト path=c:\RailsInstaller\ImageMagick-6.7.9-Q8;%path%または使用しているバージョンに入力します。

次に、入力します

gem install rmagick -- '--with-opt-dir="c:\RailsInstaller\ImageMagick-6.7.9-Q8"'

最後に C:\RailsInstaller\Ruby2.0.0\setup_environment.bat を編集して、ImageMagic へのパスを含めます。

25行目:SET PATH=c:\RailsInstaller\ImageMagick-6.7.9-Q8;またはあなたが持っているバージョン

于 2015-02-11T12:29:37.667 に答える