###前提・実現したいこと
docker-compose内の、railsアプリケーションでgem "mecab"
を使用したい。
###発生している問題・エラーメッセージ
$ docker-compose run rails gem install mecab Fetching: mecab-0.996.gem (100%) Building native extensions. This could take a while... ERROR: Error installing mecab: Building native extensions. This could take a while... ERROR: Error installing mecab: ERROR: Failed to build gem native extension. current directory: /usr/local/bundle/gems/mecab-0.996/ext/mecab /usr/local/bin/ruby -r ./siteconf20161125-1-k6eun4.rb extconf.rb checking for make... yes *** 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=/usr/local/bin/$(RUBY_BASE_NAME) --with-mecab-config --without-mecab-config --enable-mecab-config --disable-mecab-config extconf.rb:12:in ``': No such file or directory - mecab-config (Errno::ENOENT) from extconf.rb:12:in `<main>' To see why this extension failed to compile, please check the mkmf.log which can be found here: /usr/local/bundle/extensions/x86_64-linux/2.3.0-static/mecab-0.996/mkmf.log extconf failed, exit code 1
docker.compose.yml内はこんな感じです。
docker
1version: "2" 2services: 3 mysql: 4 container_name: mysql 5 image: mysql:5.7.15 6 environment: 7 MYSQL_ROOT_PASSWORD: "admin" 8 MYSQL_DATABASE: myapp_test 9 10 rails: 11 container_name: rails 12 build: . 13 command: bundle exec rails s -p 3000 -b '0.0.0.0' 14 volumes: 15 - ./:/myapp 16 ports: 17 - "3000:3000" 18 depends_on: 19 - mysql 20 links: 21 - mysql
###補足情報(言語/FW/ツール等のバージョンなど)
是非よろしくおねがいします。
`/usr/local/bundle/extensions/x86_64-linux/2.3.0-static/mecab-0.996/mkmf.log` エラー文からは上記のログに詳細な情報が入っていることが読み取れますので、上記ログの内容も記述をお願いします。