1

Edit: I am using Mac OS 10.12.3

I've tried using rvm with ruby-2.4.1. Was trying to follow the steps on here: https://help.github.com/articles/setting-up-your-github-pages-site-locally-with-jekyll/

Here's my logs (when i try bundle install):

An error occurred while installing eventmachine (1.2.7), and Bundler
cannot continue.
Make sure that `gem install eventmachine -v '1.2.7' --source
'https://rubygems.org/'` succeeds before bundling. current directory:
/Users/mins/.rvm/gems/ruby-2.4.1/gems/eventmachine-1.2.7/ext
/Applications/MAMP/Library/bin/ruby -r ./siteconf20180816-33407-1kj3dfq.rb
extconf.rb
*** 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.

mkmf.log:

"clang -o conftest -I/Applications/MAMP/Library/include/ruby-2.3.0/x86_64-darwin13 -I/Applications/MAMP/Library/include/ruby-2.3.0/ruby/backward -I/Applications/MAMP/Library/include/ruby-2.3.0 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT   -pipe conftest.c  -L. -L/Applications/MAMP/Library/lib -L. -fstack-protector     -lruby-static -framework CoreFoundation  -lpthread -ldl -lobjc "
ld: library not found for -lruby-static
clang: error: linker command failed with exit code 1 (use -v to see invocation)
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: int main(int argc, char **argv)
4: {
5:   return 0;
6: }
/* end */

| pkg-config --libs openssl
=> "dyld: Symbol not found: __cg_jpeg_resync_to_restart\n"
=> "  Referenced from: /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO\n"
=> "  Expected in: /Applications/MAMP/Library/lib/libJPEG.dylib\n"
=> " in /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO\n"
MIN S
  • 125
  • 2
  • 13

1 Answers1

0

This blog post points out to "Conflict between dynamic linking priority in OSX?".

In particular, assuming you are on MacOS:

putting the following variable in my bash_profile:

export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:/usr/local/lib/

And/Or:

Solution is to delete some dlylibs in the /usr/local/lib directory and create symbolic links to related files /System/Library/Frameworks/ImageIO.framework/Resources/:

$ cd /usr/local/lib
$ rm libgif.dylib
$ ln -s /System/Library/Frameworks/ImageIO.framework/Resources/libGIF.dylib libGIF.dylib
$ rm libjpeg.dylib
$ ln -s /System/Library/Frameworks/ImageIO.framework/Resources/libJPEG.dylib libJPEG.dylib
$ rm libtiff.dylib
$ ln -s /System/Library/Frameworks/ImageIO.framework/Resources/libTIFF.dylib libTIFF.dylib
$ rm libpng.dylib
$ ln -s /System/Library/Frameworks/ImageIO.framework/Resources/libPng.dylib libPng.dylib
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Hey there, appreciate the resources! I tried adding the export statement into .bash_profile and using source .bash_profile, that didn't seem to work when I tried to bundle install again (got the same error). Then I tried to follow the instructions to go into usr/local/lib and remove libgif.dylib but it says No such file or directory – MIN S Aug 16 '18 at 06:51
  • @MINS What OS are you using? – VonC Aug 16 '18 at 06:52
  • Mac OS 10.12.3 @VonC – MIN S Aug 16 '18 at 07:34
  • @MINS Is there any other `libXXX.dylib` file in `/usr/local/lib`? Can you do the `ln -s` part, even if the `rm` part fails? – VonC Aug 16 '18 at 07:36
  • this is what i have inside: libruby.2.3.0.dylib libruby.2.3.dylib libyaml-0.2.dylib – MIN S Aug 16 '18 at 08:16
  • okay I just tried the ln commands. Those can be executed, but bundle install still gives me an error: An error occurred while installing eventmachine (1.2.7), and Bundler cannot continue. Make sure that `gem install eventmachine -v '1.2.7' --source 'https://rubygems.org/'` succeeds before bundling. @VonC – MIN S Aug 16 '18 at 08:21
  • @MINS Do you still have your `DYLD_LIBRARY_PATH` set to `$DYLD_LIBRARY_PATH:/usr/local/lib/` in your current session where you type `bundle install`? – VonC Aug 16 '18 at 08:23
  • Yep, its in the same session and its set to /usr/local/lib/ @VonC – MIN S Aug 16 '18 at 09:31