state-machines / state_machines

Adds support for creating state machines for attributes on any Ruby class
https://github.com/state-machines/state_machines
MIT License
814 stars 91 forks source link

Bundle install on El Capitan #33

Closed jankeesvw closed 8 years ago

jankeesvw commented 8 years ago

When I'm trying to install this gem with OSX El Capitan I get this error:

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

    /Users/jankeesvw/.rbenv/versions/2.0.0-p645/bin/ruby extconf.rb
checking for rb_trap_immediate in ruby.h,rubysig.h... no
checking for rb_thread_blocking_region()... yes
checking for inotify_init() in sys/inotify.h... no
checking for __NR_inotify_init in sys/syscall.h... no
checking for writev() in sys/uio.h... yes
checking for rb_wait_for_single_fd()... yes
checking for rb_enable_interrupt()... no
checking for rb_time_new()... yes
checking for sys/event.h... yes
checking for sys/queue.h... yes
creating Makefile

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

Gem files will remain installed in /Users/jankeesvw/.rbenv/versions/2.0.0-p645/lib/ruby/gems/2.0.0/gems/eventmachine-1.0.3 for inspection.
Results logged to /Users/jankeesvw/.rbenv/versions/2.0.0-p645/lib/ruby/gems/2.0.0/gems/eventmachine-1.0.3/ext/gem_make.out
An error occurred while installing eventmachine (1.0.3), and Bundler cannot continue.
Make sure that `gem install eventmachine -v '1.0.3'` succeeds before bundling.
seuros commented 8 years ago
brew install openssl

You can try to reinstall ruby rbenv install 2.0.0 (you should update to latest patch version or 2.2.3)

Note: I don't have a Mac.. yet.

jankeesvw commented 8 years ago
brew install openssl
Warning: openssl-1.0.2d_1 already installed
seuros commented 8 years ago

Sorry, I can't help much since afaik Apple removed the headers of openssl from El Captain. Also this issue is unrelated to state_machines, the bug is in eventmachine(which is another gem).

pboling commented 8 years ago

@jankeesvw After upgrading Mac OS X, you will likely have to reinstall all Rubies, or compiled gems will fail when they re-build on updates. I did a writeup here: http://www.railsbling.com/posts/el-capitan-homebrew-ruby-qt5-java/

mikev-mogo commented 8 years ago

@jankeesvw Found the solution on this blog: http://aliswell.com/. It worked for me. It's in Japanese but google is your friend. However, the solution is to refer to the openssl installed with homebrew when compile. Run the following command: $ bundle config build . EventMachine - with - CPPFLAGS = - I $ ( brew - prefix openssl ) / include and then the usual: $ bundle install

benbalter commented 8 years ago

For those trying to copy/paste @mikev-mogo's solution (which worked for me), here's the proper spacing:

  1. bundle config build.eventmachine --with-cppflags=-I$(brew --prefix openssl)/include
  2. bundle install

See also https://stackoverflow.com/questions/30818391/gem-eventmachine-fatal-error-openssl-ssl-h-file-not-found.

fguillen commented 8 years ago

@mikev-mogo @benbalter :+1: