【问题标题】:Issues with High Sierra 10.13.1 and Rails?High Sierra 10.13.1 和 Rails 的问题?
【发布时间】:2017-12-03 06:14:27
【问题描述】:

我尝试在高山上安装 Rails,但一直收到“无法构建 gem 原生扩展”错误。

checking for sys/epoll.h... no

^ 这是我需要看的。我不确定这是否是新操作系统的问题...可能是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);

【问题讨论】:

  • 这只是显示一些警告 - 没有什么应该是致命的。关于 sys/epoll.h 的那行只是信息性的(它正在检查哪些功能可用,而 epoll 在 macos 上不存在)
  • 您是否安装了 Xcode 及其开发人员命令行工具?你是否至少打开过一次 Xcode 并接受了它的许可?
  • 我有 Xcode 9.1 和命令行工具。但是,只有版本 9 或 9.2 BETA。我都试过了......应该9工作吗?我也有 High Sierra v 10.13.1
  • 对不起,这里是我看到的命令行工具的版本。 9、9.0.1、9.2 测试版

标签: ruby-on-rails ruby web rubygems


【解决方案1】:

这是 High Sierra 和 xCode 的问题。我首先将我的机器重新格式化为 El Capitan,安装 Rails 没有问题。然后在另一台装有 High Sierra 的机器上,我也遇到了 Rails 的问题。

更新到 xCode 9.2 后,我成功安装了 Rails 5.1.4。

谢谢大家。

【讨论】:

    猜你喜欢
    • 2018-06-22
    • 1970-01-01
    • 2018-05-08
    • 1970-01-01
    • 2018-03-10
    • 2018-03-18
    • 2018-12-02
    • 2018-05-06
    • 2018-04-29
    相关资源
    最近更新 更多