Ruby
Rails
homebrew
RubyonRails4.0

airbnb クローンスクリプトでbundle installした時のエラー

More than 1 year has passed since last update.

airbnb クローンスクリプト(http://sharingeconomies.jp/ )をローカルでbundle install したところ下記のエラーがでました。

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.



checking for BIO_read() in -lcrypto... no
checking for BIO_read() in -llibeay32... no
*** 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/hatori/.rbenv/versions/2.3.1/bin/$(RUBY_BASE_NAME)
--with-puma_http11-dir
--without-puma_http11-dir
--with-puma_http11-include
--without-puma_http11-include=${puma_http11-dir}/include
--with-puma_http11-lib
--without-puma_http11-lib=${puma_http11-dir}/lib
--with-cryptolib
--without-cryptolib
--with-libeay32lib
--without-libeay32lib

To see why this extension failed to compile, please check the mkmf.log which can be found here:



extconf failed, exit code 1

Gem files will remain installed in



An error occurred while installing puma (2.11.1), and Bundler cannot continue.
Make sure that `gem install puma -v '2.11.1'` succeeds before bundling.

In Gemfile:
puma

pumaのgemがインストールできない。調べてみると、opensslが悪さをしてるみたい。

xcode-select --install

brew link --force openssl



checking for Ruby version >= 1.8.5... yes
checking for clang... yes
checking for Magick-config... no
checking for pkg-config... yes
checking for ImageMagick version >= 6.4.9... yes
checking for stdint.h... yes
checking for sys/types.h... yes
checking for wand/MagickWand.h... no

Can't install RMagick 2.13.4. Can't find MagickWand.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.


続いてrmagickのエラー

brew uninstall imagemagick

brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/6f014f2b7f1f9e618fd5c0ae9c93befea671f8be/Formula/imagemagick.rb

gem install rmagick

インストールし直しで解決。

bundle install

成功!!!!