安装eventmachine(1.0.3)时发生错误,Bundler无法继续

时间:2015-08-07 14:50:27

标签: ruby-on-rails ruby ruby-on-rails-3 ruby-on-rails-4 rubygems

我正试图在我的运行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.

4 个答案:

答案 0 :(得分:6)

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]

答案 1 :(得分:4)

如果您使用的是eventmachineruby version >= 2.2

请将Gemfile中的eventmachine更新为1.0.4

Gemfile中的

gem `eventmachine', '~>1.0.4'

了解更多信息

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

答案 2 :(得分:1)

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

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

答案 3 :(得分:1)

我发现该问题已解决:先删除 Gemfile.lock ,然后在中使用 http 而不是 https Gemfile 的源,然后使用命令

重建 Gemfile.lock

bundle exec jekyll build

我在GitHub Gist上创建了boilerplate Gemfile,您也可以使用它。