安装 eventmachine (1.0.3) 时出错,Bundler 无法继续

问题描述 投票:0回答:5

我正在尝试在运行 os x 10.10 的 Mac 上安装 ruby on Rails。我正在尝试让服务器运行开源项目 kandan,但是在尝试在 eventmachine 1.0.3 gem 上捆绑安装时遇到错误。我不确定我到底在看什么,有人可以帮我解决这个问题吗?

bundle install
Fetching gem metadata from https://rubygems.org/.............
Fetching version metadata from https://rubygems.org/...
Fetching dependency metadata from https://rubygems.org/..
Using rake 10.4.2
Using i18n 0.6.11
Using multi_json 1.10.1
Using activesupport 3.2.21
Using builder 3.0.4
Using activemodel 3.2.21
Using erubis 2.7.0
Using journey 1.0.4
Using rack 1.4.5
Using rack-cache 1.2
Using rack-test 0.6.2
Using hike 1.2.3
Using tilt 1.4.1
Using sprockets 2.2.3
Using actionpack 3.2.21
Using mime-types 1.25.1
Using polyglot 0.3.5
Using treetop 1.4.15
Using mail 2.5.4
Using actionmailer 3.2.21
Using arel 3.0.3
Using tzinfo 0.3.42
Using activerecord 3.2.21
Using activeresource 3.2.21
Using addressable 2.3.6
Using awesome_print 1.2.0
Using json 1.8.1
Using mini_portile 0.5.3
Using nokogiri 1.6.1
Using uuidtools 2.1.4
Using aws-sdk 1.38.0
Using bcrypt 3.1.7
Using coderay 1.1.0
Using better_errors 1.1.0
Using debug_inspector 0.0.2
Using binding_of_caller 0.7.2
Using sass 3.2.13
Using bootstrap-sass 3.1.1.0
Using thor 0.19.1
Using bourbon 3.1.8
Using columnize 0.8.9
Using debugger-linecache 1.2.0
Using byebug 3.2.0
Using cancancan 1.9.2
Using xpath 2.0.0
Using capybara 2.4.4
Using hitimes 1.2.2
Using timers 4.0.1
Using celluloid 0.16.0
Using ffi 1.9.6
Using childprocess 0.5.5
Using climate_control 0.0.3
Using cliver 0.3.2
Using cocaine 0.5.4
Using coffee-script-source 1.7.0
Using execjs 2.0.2
Using coffee-script 2.2.0
Using rack-ssl 1.3.4
Using rdoc 3.12.2
Using railties 3.2.21
Using coffee-rails 3.2.2
Using cookiejar 0.3.2
Using rest-client 1.6.7
Using docile 1.1.3
Using simplecov-html 0.8.0
Using simplecov 0.8.2
Using tins 1.1.0
Using term-ansicolor 1.3.0
Using coveralls 0.7.0
Using daemons 1.1.9
Using database_cleaner 1.2.0
Using orm_adapter 0.5.0
Using thread_safe 0.3.3
Using warden 1.2.3
Using devise 3.2.4
Using diff-lcs 1.2.5
Using eco-source 1.1.0.rc.1
Using eco 1.0.0
Installing eventmachine 1.0.3 with native extensions

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    /Users/dan/.rbenv/versions/2.2.2/bin/ruby -r ./siteconf20150808-95277-1j9ketn.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/dan/.rbenv/versions/2.2.2/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/dan/.rbenv/versions/2.2.2/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/dan/.rbenv/versions/2.2.2/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

Gem files will remain installed in /Users/dan/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/eventmachine-1.0.3 for inspection.
Results logged to /Users/dan/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/extensions/x86_64-darwin-14/2.2.0-static/eventmachine-1.0.3/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.
ruby-on-rails ruby ruby-on-rails-3 ruby-on-rails-4 rubygems
5个回答
7
投票

Eventmachine 1.0.3 与 Ruby 2.2+ 不兼容,请尝试升级到较新的版本。

阅读 CHANGELOG: 您应该至少升级到 1.0.4:https://github.com/eventmachine/eventmachine/blob/master/CHANGELOG.md#104-december-19-2014

修复 ruby 2.2 上的构建 [#503]


7
投票

如果您使用

eventmachine
ruby version >= 2.2

请将 Gemfile 中的 eventmachine 更新至 1.0.4

在 Gemfile 中

gem `eventmachine', '~>1.0.4'

了解更多信息

https://github.com/eventmachine/eventmachine/issues/553


2
投票

即使使用

eventmachine -v '1.0.4'
我也遇到了同样的问题。我成功解决了这个问题。

gem install eventmachine -v '1.0.4'  -- --with-cppflags=-I/usr/local/opt/openssl/include

1
投票

我发现,删除 Gemfile.lock,然后在 Gemfilesource 中使用 http 而不是 https,然后使用命令重建 Gemfile.lock

,问题就得到了解决。

bundle exec jekyll build

我在 GitHub Gist 上制作了一个 样板 Gemfile,你也可以使用它。


0
投票

对我来说,答案是

xcode-select --install
,然后单击“是”进行安装

© www.soinside.com 2019 - 2024. All rights reserved.