Reputation: 744
Here is the full output of the error message:
Fetching: eventmachine-1.0.3.gem (100%)
Building native extensions. This could take a while...
ERROR: Error installing eventmachine:
ERROR: Failed to build gem native extension.
/Users/Tyler/.rvm/rubies/ruby-2.2.0/bin/ruby -r ./siteconf20141229-47086-wfdm3m.rb extconf.rb
checking for rb_trap_immediate in ruby.h,rubysig.h... no
checking for rb_thread_blocking_region()... no
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=" clean
make "DESTDIR="
compiling binder.cpp
compiling cmain.cpp
compiling ed.cpp
compiling em.cpp
em.cpp:827:9: error: use of undeclared identifier 'rb_thread_select'; did you mean 'rb_thread_fd_select'?
return EmSelect (maxsocket+1, &fdreads, &fdwrites, &fderrors, &tv);
^~~~~~~~
rb_thread_fd_select
./em.h:25:20: note: expanded from macro 'EmSelect'
#define EmSelect rb_thread_select
^
/Users/Tyler/.rvm/rubies/ruby-2.2.0/include/ruby-2.2.0/ruby/intern.h:454:5: note: 'rb_thread_fd_select' declared here
int rb_thread_fd_select(int, rb_fdset_t *, rb_fdset_t *, rb_fdset_t *, struct timeval *);
^
em.cpp:827:32: error: cannot initialize a parameter of type 'rb_fdset_t *' with an rvalue of type 'fd_set *'
return EmSelect (maxsocket+1, &fdreads, &fdwrites, &fderrors, &tv);
^~~~~~~~
/Users/Tyler/.rvm/rubies/ruby-2.2.0/include/ruby-2.2.0/ruby/intern.h:454:42: note: passing argument to parameter here
int rb_thread_fd_select(int, rb_fdset_t *, rb_fdset_t *, rb_fdset_t *, struct timeval *);
^
em.cpp:946:6: error: use of undeclared identifier 'rb_thread_select'; did you mean 'rb_thread_fd_select'?
EmSelect (0, NULL, NULL, NULL, &tv);
^~~~~~~~
rb_thread_fd_select
./em.h:25:20: note: expanded from macro 'EmSelect'
#define EmSelect rb_thread_select
^
/Users/Tyler/.rvm/rubies/ruby-2.2.0/include/ruby-2.2.0/ruby/intern.h:454:5: note: 'rb_thread_fd_select' declared here
int rb_thread_fd_select(int, rb_fdset_t *, rb_fdset_t *, rb_fdset_t *, struct timeval *);
^
3 errors generated.
make: *** [em.o] Error 1
make failed, exit code 2
Has anyone seen an error like this before? I have the command line tools - never ran into an error compiling this gem on my old laptop also running Yosemite.
Upvotes: 28
Views: 13190
Reputation: 321
First set the path of the brew openssl executable in your shell. (zshrc or bashrc). Source your shell.
Then do
which openssl
Get the output and use it in your gem install dir path.
gem install eventmachine -v '1.2.7' -- --with-openssl-dir=/usr/local/opt/[email protected]/bin/openssl
This worked for me.
Upvotes: 0
Reputation: 2351
I understand this question has been asked quite a while ago but I've seen this error just now and after trying all answers and struggling with this and another couple of gems I've realized that as I was trying to install a pretty old project and therefore some gems were not compatible with current libs and most of them were actually requirements for the actual project gems.
What I did then was remove the Gemfile.lock
file and let bundler
recreate it with more current references for the dependency gems and that worked for my case and therefore I'm contributing to others that eventually get on the same situation:
rm Gemfile.lock
bundle install
Hope that helps!
Upvotes: 0
Reputation: 91
Try this
gem install eventmachine -- --with-cppflags=-I/usr/local/opt/openssl/include
Upvotes: 8
Reputation: 369
if you have brew install, try
brew install openssl
and if it still says,
Warning: openssl-1.0.2e already installed
then run this command ,
brew link openssl --force
it will do the trick. :)
Upvotes: 16
Reputation: 1272
For El Captain, this worked for me:
$ bundle update eventmachine # updated to v1.0.8
$ bundle config build.eventmachine --with-cppflags=-I/usr/local/opt/openssl/include
$ bundle install
Upvotes: 46
Reputation: 1287
EventMachine 1.0.3 didn’t work with Ruby 2.2. This was fixed in EventMachine 1.0.4. You can most likely fix your situation by upgrading EventMachine with
bundle update eventmachine
Upvotes: 47
Reputation: 1042
In case the above answer doesn't help you, you can try downgrading your Ruby version to 2.1.2. That did the trick for me (OS 10.10.2). Add this at the top of your Gemfile:
ruby '2.1.2'
Upvotes: 1
Reputation: 138
I remember installing another gem that required eventmachine and it gave me problems in windows. I had to install DevKit tools and that resolved my issue. sorry i cannot provide more details but I hope it helps to solve your issue. you can also try what Prakash shared above. I had to update myself in the end after installing Devkit.
Upvotes: 0