Ruby on rails 安装eventmachine(1.0.3)时出错,捆绑程序无法继续

Ruby on rails 安装eventmachine(1.0.3)时出错,捆绑程序无法继续,ruby-on-rails,ruby,ruby-on-rails-3,ruby-on-rails-4,rubygems,Ruby On Rails,Ruby,Ruby On Rails 3,Ruby On Rails 4,Rubygems,我正试图让RubyonRails在运行OSX10.10的mac上安装。我正在尝试让服务器运行开源项目kandan,但是在尝试捆绑安装eventmachine 1.0.3 gem时出错。我不确定我到底在看什么,有人能帮我解决这个问题吗 bundle install Fetching gem metadata from https://rubygems.org/............. Fetching version metadata from https://rubygems.org/...

我正试图让RubyonRails在运行OSX10.10的mac上安装。我正在尝试让服务器运行开源项目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.

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

阅读变更日志:您至少应该升级到1.0.4:

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


如果您使用的是
eventmachine
ruby版本>=2.2

请将Gemfile中的eventmachine更新为1.0.4

归档

gem `eventmachine', '~>1.0.4'
更多信息


即使使用
eventmachine-v'1.0.4'
,我也面临同样的问题。我成功地解决了这个问题

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

我发现这个问题在删除Gemfile.lock并在Gemfile的源代码中使用http而不是https,然后使用命令重新生成Gemfile.lock时得到了解决

bundle exec jekyll build

我在GitHub Gist上做了一个更新,你也可以使用它。

你需要将eventmachine更新到1.0.4,才能使它与Ruby 2.2.0一起工作完美谢谢,很抱歉我自己找不到解决方案!