rmagickの導入しgem 'rmagick'をbundle installしたところでエラーがでる
- 評価
- クリップ 0
- VIEW 3,640

退会済みユーザー
rmagickの導入
以下がImageMagickのバージョンです。7ではなく6でないとダメといろんなところに書かれていますが、6なのでしょうか?
$ convert -version
Version: ImageMagick 6.9.10-14 Q16 x86_64 2018-10-25
Gemfile
gem 'rmagick'
$ bundle install
エラーコード
mba:mimi 名前$ bundle install
The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x86-mswin32, x64-mingw32, java. To add those platforms to the bundle, run `bundle lock --add-platform x86-mingw32 x86-mswin32 x64-mingw32 java`.
Fetching gem metadata from https://rubygems.org/.........
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies...
Using rake 12.3.2
Using concurrent-ruby 1.1.4
Using i18n 1.2.0
Using minitest 5.11.3
Using thread_safe 0.3.6
Using tzinfo 1.2.5
Using activesupport 5.2.2
Using builder 3.2.3
Using erubi 1.7.1
Using mini_portile2 2.4.0
Using nokogiri 1.9.1
Using rails-dom-testing 2.0.3
Using crass 1.0.4
Using loofah 2.2.3
Using rails-html-sanitizer 1.0.4
Using actionview 5.2.2
Using rack 2.0.6
Using rack-test 1.1.0
Using actionpack 5.2.2
Using nio4r 2.3.1
Using websocket-extensions 0.1.3
Using websocket-driver 0.7.0
Using actioncable 5.2.2
Using globalid 0.4.1
Using activejob 5.2.2
Using mini_mime 1.0.1
Using mail 2.7.1
Using actionmailer 5.2.2
Using activemodel 5.2.2
Using arel 9.0.0
Using activerecord 5.2.2
Using mimemagic 0.3.2
Using marcel 0.3.3
Using activestorage 5.2.2
Using public_suffix 3.0.3
Using addressable 2.5.2
Using io-like 0.3.0
Using archive-zip 0.11.0
Using execjs 2.7.0
Using autoprefixer-rails 9.4.2
Using bcrypt 3.1.12
Using bindex 0.5.0
Using msgpack 1.2.4
Using bootsnap 1.3.2
Using popper_js 1.14.5
Using rb-fsevent 0.10.3
Using ffi 1.9.25
Using rb-inotify 0.10.0
Using sass-listen 4.0.0
Using sass 3.7.2
Using bootstrap 4.1.3
Using bundler 1.17.2
Using byebug 10.0.2
Using regexp_parser 1.3.0
Using xpath 3.2.0
Using capybara 3.12.0
Using mime-types-data 3.2018.0812
Using mime-types 3.2.2
Using carrierwave 1.2.3
Using childprocess 0.9.0
Using chromedriver-helper 2.1.0
Using coffee-script-source 1.12.2
Using coffee-script 2.4.1
Using method_source 0.9.2
Using thor 0.20.3
Using railties 5.2.2
Using coffee-rails 4.2.2
Using orm_adapter 0.5.0
Using responders 2.4.0
Using warden 1.2.8
Using devise 4.5.0
Using multi_json 1.13.1
Using jbuilder 2.8.0
Using jquery-rails 4.3.3
Using ruby_dep 1.5.0
Using listen 3.1.5
Using puma 3.12.0
Using sprockets 3.7.2
Using sprockets-rails 3.2.1
Using rails 5.2.2
Fetching rmagick 2.16.0
Installing rmagick 2.16.0 with native extensions
Errno::EACCES: Permission denied @ rb_sysopen - /Users/名前/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rmagick-2.16.0/.editorconfig
An error occurred while installing rmagick (2.16.0), and Bundler cannot continue.
Make sure that `gem install rmagick -v '2.16.0' --source 'https://rubygems.org/'` succeeds before bundling.
In Gemfile:
rmagick
管理者バージョンで
$ sudo bundle install
エラーコード
Password:
Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.
The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x86-mswin32, x64-mingw32, java. To add those platforms to the bundle, run `bundle lock --add-platform x86-mingw32 x86-mswin32 x64-mingw32 java`.
Fetching gem metadata from https://rubygems.org/.........
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies...
Using rake 12.3.2
Using concurrent-ruby 1.1.4
Using i18n 1.2.0
Using minitest 5.11.3
Using thread_safe 0.3.6
Using tzinfo 1.2.5
Using activesupport 5.2.2
Using builder 3.2.3
Using erubi 1.7.1
Using mini_portile2 2.4.0
Using nokogiri 1.9.1
Using rails-dom-testing 2.0.3
Using crass 1.0.4
Using loofah 2.2.3
Using rails-html-sanitizer 1.0.4
Using actionview 5.2.2
Using rack 2.0.6
Using rack-test 1.1.0
Using actionpack 5.2.2
Using nio4r 2.3.1
Using websocket-extensions 0.1.3
Using websocket-driver 0.7.0
Using actioncable 5.2.2
Using globalid 0.4.1
Using activejob 5.2.2
Using mini_mime 1.0.1
Using mail 2.7.1
Using actionmailer 5.2.2
Using activemodel 5.2.2
Using arel 9.0.0
Using activerecord 5.2.2
Using mimemagic 0.3.2
Using marcel 0.3.3
Using activestorage 5.2.2
Using public_suffix 3.0.3
Using addressable 2.5.2
Using io-like 0.3.0
Using archive-zip 0.11.0
Using execjs 2.7.0
Using autoprefixer-rails 9.4.2
Using bcrypt 3.1.12
Using bindex 0.5.0
Using msgpack 1.2.4
Using bootsnap 1.3.2
Using popper_js 1.14.5
Using rb-fsevent 0.10.3
Using ffi 1.9.25
Using rb-inotify 0.10.0
Using sass-listen 4.0.0
Using sass 3.7.2
Using bootstrap 4.1.3
Using bundler 1.17.2
Using byebug 10.0.2
Using regexp_parser 1.3.0
Using xpath 3.2.0
Using capybara 3.12.0
Using mime-types-data 3.2018.0812
Using mime-types 3.2.2
Using carrierwave 1.2.3
Using childprocess 0.9.0
Using chromedriver-helper 2.1.0
Using coffee-script-source 1.12.2
Using coffee-script 2.4.1
Using method_source 0.9.2
Using thor 0.20.3
Using railties 5.2.2
Using coffee-rails 4.2.2
Using orm_adapter 0.5.0
Using responders 2.4.0
Using warden 1.2.8
Using devise 4.5.0
Using multi_json 1.13.1
Using jbuilder 2.8.0
Using jquery-rails 4.3.3
Using ruby_dep 1.5.0
Using listen 3.1.5
Using puma 3.12.0
Using sprockets 3.7.2
Using sprockets-rails 3.2.1
Using rails 5.2.2
Fetching rmagick 2.16.0
Installing rmagick 2.16.0 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /Users/名前/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rmagick-2.16.0/ext/RMagick
/Users/名前/.rbenv/versions/2.5.1/bin/ruby -r ./siteconf20181219-37471-1k2er0s.rb extconf.rb
checking for clang... yes
checking for Magick-config... yes
checking for outdated ImageMagick version (<= 6.4.9)... no
checking for presence of MagickWand API (ImageMagick version >= 6.9.0)... no
Package MagickWand was not found in the pkg-config search path.
Perhaps you should add the directory containing `MagickWand.pc'
to the PKG_CONFIG_PATH environment variable
No package 'MagickWand' found
Package MagickWand was not found in the pkg-config search path.
Perhaps you should add the directory containing `MagickWand.pc'
to the PKG_CONFIG_PATH environment variable
No package 'MagickWand' found
Package MagickWand was not found in the pkg-config search path.
Perhaps you should add the directory containing `MagickWand.pc'
to the PKG_CONFIG_PATH environment variable
No package 'MagickWand' found
Package MagickWand was not found in the pkg-config search path.
Perhaps you should add the directory containing `MagickWand.pc'
to the PKG_CONFIG_PATH environment variable
No package 'MagickWand' found
checking for Ruby version >= 1.8.5... yes
Package MagickCore was not found in the pkg-config search path.
Perhaps you should add the directory containing `MagickCore.pc'
to the PKG_CONFIG_PATH environment variable
No package 'MagickCore' found
Can't install RMagick 2.16.0. Can't find the ImageMagick library or one of the dependent libraries. Check the mkmf.log file for more detailed information.
*** 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=/Users/名前/.rbenv/versions/2.5.1/bin/$(RUBY_BASE_NAME)
To see why this extension failed to compile, please check the mkmf.log which can be found here:
/Users/名前/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/extensions/x86_64-darwin-17/2.5.0-static/rmagick-2.16.0/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in /Users/名前/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rmagick-2.16.0 for inspection.
Results logged to /Users/名前/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/extensions/x86_64-darwin-17/2.5.0-static/rmagick-2.16.0/gem_make.out
An error occurred while installing rmagick (2.16.0), and Bundler cannot continue.
Make sure that `gem install rmagick -v '2.16.0' --source 'https://rubygems.org/'` succeeds before bundling.
In Gemfile:
rmagick
mba:mimi 名前$
ここがわかりにくいと言った指摘やこの情報も追加して。などのコメントも待っております。よろしくお願いします。
-
気になる質問をクリップする
クリップした質問は、後からいつでもマイページで確認できます。
またクリップした質問に回答があった際、通知やメールを受け取ることができます。
クリップを取り消します
-
良い質問の評価を上げる
以下のような質問は評価を上げましょう
- 質問内容が明確
- 自分も答えを知りたい
- 質問者以外のユーザにも役立つ
評価が高い質問は、TOPページの「注目」タブのフィードに表示されやすくなります。
質問の評価を上げたことを取り消します
-
評価を下げられる数の上限に達しました
評価を下げることができません
- 1日5回まで評価を下げられます
- 1日に1ユーザに対して2回まで評価を下げられます
質問の評価を下げる
teratailでは下記のような質問を「具体的に困っていることがない質問」、「サイトポリシーに違反する質問」と定義し、推奨していません。
- プログラミングに関係のない質問
- やってほしいことだけを記載した丸投げの質問
- 問題・課題が含まれていない質問
- 意図的に内容が抹消された質問
- 過去に投稿した質問と同じ内容の質問
- 広告と受け取られるような投稿
評価が下がると、TOPページの「アクティブ」「注目」タブのフィードに表示されにくくなります。
質問の評価を下げたことを取り消します
この機能は開放されていません
評価を下げる条件を満たしてません
質問の評価を下げる機能の利用条件
この機能を利用するためには、以下の事項を行う必要があります。
- 質問回答など一定の行動
-
メールアドレスの認証
メールアドレスの認証
-
質問評価に関するヘルプページの閲覧
質問評価に関するヘルプページの閲覧
checkベストアンサー
0
gem rmagickのインストールでこけるのはだいたいImageMagickのライブラリが見つからないことが多いです。
bundle installで失敗したログの中に Magick.core がないとか、PKG_CONFIG がどうとか記述はありますか?
もしログを全部貼り付けていなければ全体を貼り付けてもらえるとさらに詳細にわかるかもしれません。
---追記---
Errno::EACCES: Permission denied @ rb_sysopen - /Users/名前/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/rmagick-2.16.0/.editorconfig
とありますね。
bundle_install しているユーザーが、必要なファイルにアクセスできないようですね。
ユーザーの問題の気がします。
(ちゃんとした回答になっていなくてすみません!)
投稿
-
回答の評価を上げる
以下のような回答は評価を上げましょう
- 正しい回答
- わかりやすい回答
- ためになる回答
評価が高い回答ほどページの上位に表示されます。
-
回答の評価を下げる
下記のような回答は推奨されていません。
- 間違っている回答
- 質問の回答になっていない投稿
- スパムや攻撃的な表現を用いた投稿
評価を下げる際はその理由を明確に伝え、適切な回答に修正してもらいましょう。
15分調べてもわからないことは、teratailで質問しよう!
- ただいまの回答率 88.13%
- 質問をまとめることで、思考を整理して素早く解決
- テンプレート機能で、簡単に質問をまとめられる
2018/12/19 13:37
エラーコードを読めて羨ましいです。
ユーザーに問題ですか。。。
ちょっと調べてみます。
2018/12/19 15:46
1.
warningもでていますが、
sudo で bundle install することもあまりないので環境構築をもう一度したほうがいいかもしれません。
ほかのgemはsudoせずにはいりましたか?
2.
rmgickはimage magickを railsで使う為の中間ソフトみたいな位置付けのgemなのですが、image magicのインストール方法によってライブラリの置かれるフォルダが変わります。
なので、そのフォルダへのパスを通すか、gemを入れるときに指定しないといけないはずです。
2についてはGoogleで検索すればでてくるはずです!
2018/12/20 12:53
上記の記事を参考にいろんな人の力を借りてなんとかできました。
sudoでやってしまったのですが、https://teratail.com/questions/164773で解除する方法を教えてもらいなんとかrmagickを導入できました。
motozziさん、ありがとうございました!