Skip to content

Common Issues Installing

Alex Cummaudo edited this page Apr 5, 2018 · 3 revisions

Contents

macOS

Bundle resolutions

You may encounter build issues when using Homebrew/Homebrew Cask to install dependencies. Some resolutions to these are listed below:

eventmachine

The eventmachine gem cannot find openssl/ssl.h when compiling with native extensions:

Installing eventmachine 1.0.3 with native extensions

...


make "DESTDIR="
compiling binder.cpp
In file included from binder.cpp:20:
./project.h:107:10: fatal error: 'openssl/ssl.h' file not found
#include <openssl/ssl.h>
         ^
1 error generated.
make: *** [binder.o] Error 1

To resolve, add the following to your global bundle config:

$ bundle config build.eventmachine --with-cppflags=-I/usr/local/opt/openssl/include

Then try installing dependencies again.

pg

The pg gem cannot find pg_config when compiling with native extensions:

Installing pg 0.17.1 with native extensions

Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

    /Users/[User]/.rbenv/versions/2.3.1/bin/ruby extconf.rb
checking for pg_config... no
No pg_config... trying anyway. If building fails, please try again with
 --with-pg-config=/path/to/pg_config
checking for libpq-fe.h... no
Can't find the 'libpq-fe.h header
*** 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.

To resolve, ensure pg_config is on the PATH:

$ export PATH=/Applications/Postgres.app/Contents/Versions/latest/bin:$PATH

or, add the following to your global bundle config:

$ bundle config build.pg --with-pg-config=/Applications/Postgres.app/Contents/Versions/latest/bin/pg_config

Then try installing dependencies again.

ruby-filemagic

The ruby-filemagic gem cannot find libmagic libraries when compiling with native extensions:

Installing ruby-filemagic 0.6.0 with native extensions

Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

    /Users/[User]/.rbenv/versions/2.3.1/bin/ruby extconf.rb
checking for magic_open() in -lmagic... no
checking for magic.h... no
*** ERROR: missing required library to compile this module
*** 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.

To resolve, add the following to your global bundle config:

$ export PKG_CONFIG_PATH="/usr/local/opt/imagemagick@6/lib/pkgconfig:$PKG_CONFIG_PATH"
$ bundle config build.ruby-filemagic --with-magic-include=/usr/local/opt/imagemagick@6/include --with-magic-lib=/usr/local/opt/imagemagick@6/lib

Then try installing dependencies again.

Sometimes, the locations of include, lib and the pkgconfig change. Ensure your variables are up to date by running brew info imagemagick@6:

For compilers to find this software you may need to set:
    LDFLAGS:  -L/usr/local/opt/imagemagick@6/lib
    CPPFLAGS: -I/usr/local/opt/imagemagick@6/include
For pkg-config to find this software you may need to set:
    PKG_CONFIG_PATH: /usr/local/opt/imagemagick@6/lib/pkgconfig

As you can see, our variables in the installation above match the variables provided in this command.

Linux

Bundle resolutions

You may encounter issues when trying to install bundle dependencies.

ruby-filemagic

The ruby-filemagic gem cannot find libmagic libraries when compiling with native extensions:

Installing ruby-filemagic 0.6.0 with native extensions

Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

    /Users/[User]/.rbenv/versions/2.3.1/bin/ruby extconf.rb
checking for magic_open() in -lmagic... no
checking for magic.h... no
*** ERROR: missing required library to compile this module
*** 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.

To resolve, add the following to your global bundle config:

$ bundle config build.ruby-filemagic --with-magic-include=/usr/local/include --with-magic-lib=/usr/lib

Then try installing dependencies again.