2017-06-03 7 views
0

これらのコマンドを使ってrmagickをインストールしようとしましたが、動作しません。rmagick install error ubunutu 16.04 ruby​​ 2.4.0p0

sudo apt-get install imagemagick 
sudo apt-get install imagemagick libmagickcore-dev libmagickwand-dev 
sudo gem install rmagick 

次のエラーで終了しました。

Building native extensions.
This could take a while...
ERROR: Error installing rmagick:
ERROR: Failed to build gem native extension.
current directory: /var/lib/gems/2.3.0/gems/rmagick-2.16.0/ext/RMagick /usr/bin/ruby2.3
-r ./siteconf20170603-20826-3to4j3.rb extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h
extconf failed, exit code 1

Gem files will remain installed in /var/lib/gems/2.3.0/gems/rmagick-2.16.0 for inspection.
Results logged to /var/lib/gems/2.3.0/extensions/x86_64-linux/2.3.0/rmagick-2.16.0/gem_make.out

答えて

0

はまたルビー-devのパッケージをインストールする必要があります。そのため、ネイティブ拡張をコンパイルするときにruby.hが見つかりません。

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

sudo apt-get install ruby-dev 

ruby​​2.3-devのパッケージをインストールするパッケージの説明、に基づか。それは私のUbuntu 16.04にインストールされたパッケージでした。

Package: ruby-dev
State: not installed
Multi-Arch: same
Version: 2:2.3.0+1bbox1~xenial1
Priority: optional
Section: devel Maintainer: Antonio Terceiro
Architecture: amd64
Uncompressed Size: 20.5 k
Depends: ruby2.3-dev
Provided by: ruby1.8-dev (1:1.8.7.375-1bbox1~xenial2)
Description: Header files for compiling extension modules for Ruby (default version) Ruby is the interpreted scripting language for quick and easy object-oriented programming. It has many features to process text files and to do system management tasks (as in perl). It is simple, straight-forward, and extensible. This package contains the header files and the mkmf library, necessary to make extension library for Ruby. It is also required to build many gems. This package is a dependency package, which depends on Debian's default Ruby version (currently v2.3).

その後、Ruby 2.4をインストールしたので、そのパッケージは自分のコンピュータにインストールされません。