Add include dir for node gyp

I've spent some time trying to answer the same question. In the end, i've found the proper way to do this here. You need to set 'include_dirs' property in ~/.node-gyp/x.x.x/common.gypi. This is how I've set the include dir on Mac OS to /opt/local/include/ (which is where all macports intalls go):

...
['OS=="mac"', {
  'defines': ['_DARWIN_USE_64_BIT_INODE=1'],
  'include_dirs': ['/opt/local/include'],
  'xcode_settings': {
    'ALWAYS_SEARCH_USER_PATHS': 'NO',
...

Though I'm not sure it's applicable for heroku environment.


Try:

setting the environment variable CXX=/path/to/g++ -Ipath/to/include

and then restarting the process. If you're using bash this is done by

export CXX="/path/to/g++ -Ipath/to/include"

/path/to/include being where the missing header Magick++.h is located

if that doesn't work you may manually have to set CXX to include the -I in the makefile at /tmp/build_720834c3a32b65d69ae603d7c618e20f/node_modules/imagemagick-native/build then cding into that directory and calling make.