0

I've tried installing Rails on a high sierra but keep receiving a "Failed to build gem native extension" error.

checking for sys/epoll.h... no

^ This is what I need to be looking at. I'm not sure if this is an issue with the new OS...possibly an issue with nio4r-2.1.0?

Building native extensions. This could take a while...
ERROR:  Error installing rails:
 ERROR: Failed to build gem native extension.

    current directory: /Users/paulkim/.rvm/gems/ruby-2.4.2/gems/nio4r-2.1.0/ext/nio4r
/Users/paulkim/.rvm/rubies/ruby-2.4.2/bin/ruby -r ./siteconf20171203-22631-czj48g.rb extconf.rb
checking for unistd.h... yes
checking for sys/select.h... yes
checking for poll.h... yes
checking for sys/epoll.h... no
checking for sys/event.h... yes
checking for sys/queue.h... yes
checking for port.h... yes
checking for sys/resource.h... yes
creating Makefile

current directory: /Users/paulkim/.rvm/gems/ruby-2.4.2/gems/nio4r-2.1.0/ext/nio4r
make "DESTDIR=" clean

current directory: /Users/paulkim/.rvm/gems/ruby-2.4.2/gems/nio4r-2.1.0/ext/nio4r
make "DESTDIR="
compiling bytebuffer.c
compiling monitor.c
compiling nio4r_ext.c
In file included from nio4r_ext.c:7:
./../libev/ev.c:488:48: warning: '/*' within block comment [-Wcomment]
/*#define MIN_INTERVAL  0.00000095367431640625 /* 1/2**20, good till 2200 */
                                               ^
./../libev/ev.c:1068:26: warning: implicit conversion loses integer precision: 'uint64_t' (aka 'unsigned long long') to 'unsigned int' [-Wshorten-64-to-32]
  return ecb_popcount32 (x) + ecb_popcount32 (x >> 32);
pkayokay
  • 55
  • 2
  • 7
  • This is only showing some warnings - nothing there that should be fatal. The line about sys/epoll.h is just informational (it is checking what features are available & epoll doesn’t exist on macos) – Frederick Cheung Dec 03 '17 at 07:20
  • Do you have Xcode and its developer command line tools installed? Did you open Xcode at least once and accepted its license? – spickermann Dec 03 '17 at 07:30
  • https://stackoverflow.com/questions/8389301/os-x-rails-failed-to-build-gem-native-extension#12229945 and https://stackoverflow.com/questions/9552292/failed-to-build-gem-native-extension – Fabrizio Bertoglio Dec 03 '17 at 08:31
  • I have Xcode 9.1, and the Command line tools. However, there was only a version 9 release or a 9.2 BETA. I tried it with both...should 9 work? I also have High Sierra v 10.13.1 – pkayokay Dec 03 '17 at 19:54
  • Sorry, here are the versions of Command Line Tools I saw. 9, 9.0.1, 9.2 Beta – pkayokay Dec 03 '17 at 20:38
  • Nvm, I opened the app store and it updated there. So I do have the correct version. – pkayokay Dec 03 '17 at 20:47

1 Answers1

0

It was an issue with High Sierra and xCode.I first reformatted my machine to El Capitan and had no issues installing Rails. Then on another machine with High Sierra I also had issues with Rails.

After updating to xCode 9.2, I successfully installed Rails 5.1.4.

Thanks everyone.

pkayokay
  • 55
  • 2
  • 7