jedi4ever / veewee

Easing the building of vagrant boxes
MIT License
4.29k stars 779 forks source link

veewee installation failed : gem eventmachine can't compile with Ruby 2.2.0 #1042

Closed Wenzel closed 9 years ago

Wenzel commented 9 years ago

Hi ! I tried to use your project today. I followed the procedure with RVM. The command bundle install fails because of a an incompatibility with the version you require to use ruby 2.2.0, but you also require to install eventmachine 1.0.0.beta.3, which can't be compiled under this version of Ruby.

ruby-2.2.0 - #gemset created /usr/local/rvm/gems/ruby-2.2.0@veewee
ruby-2.2.0 - #generating veewee wrappers..........
Using /usr/local/rvm/gems/ruby-2.2.0 with gemset veewee
Successfully installed bundler-1.8.4
Parsing documentation for bundler-1.8.4
Installing ri documentation for bundler-1.8.4
Done installing documentation for bundler after 1 seconds
1 gem installed
Don't run Bundler as root. Bundler can ask for sudo if it is needed, and
installing your bundle as root will break this application for all non-root
users on this machine.
Fetching https://github.com/hh/em-winrm.git
Fetching gem metadata from https://rubygems.org/.........
Fetching version metadata from https://rubygems.org/..
Resolving dependencies...
Using rake 10.4.2
Installing CFPropertyList 2.3.0
Installing Platform 0.4.0
Installing builder 3.2.2
Installing gyoku 1.2.2
Installing mini_portile 0.6.2
Installing nokogiri 1.6.6.2
Installing akami 1.2.2
Installing ansi 1.3.0
Using bundler 1.8.4
Installing ffi 1.9.6
Installing childprocess 0.5.5
Installing diff-lcs 1.2.5

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

    /usr/local/rvm/rubies/ruby-2.2.0/bin/ruby -r ./siteconf20150308-290-i8rx3g.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... yes
checking for writev() in sys/uio.h... yes
checking for rb_thread_check_ints()... yes
checking for rb_time_new()... yes
checking for sys/event.h... no
checking for epoll_create() in sys/epoll.h... yes
creating Makefile

make "DESTDIR=" clean

make "DESTDIR="
compiling pipe.cpp
compiling binder.cpp
compiling ssl.cpp
compiling kb.cpp
compiling page.cpp
compiling ed.cpp
compiling em.cpp
em.cpp: In member function ‘bool EventMachine_t::_RunEpollOnce()’:
em.cpp:525:65: error: ‘rb_thread_select’ was not declared in this scope
  if ((ret = rb_thread_select(epfd + 1, &fdreads, NULL, NULL, &tv)) < 1) {
                                                                 ^
em.cpp:566:37: error: ‘rb_thread_select’ was not declared in this scope
   EmSelect (0, NULL, NULL, NULL, &tv);
                                     ^
em.cpp: In member function ‘int SelectData_t::_Select()’:
em.cpp:812:67: error: ‘rb_thread_select’ was not declared in this scope
  return EmSelect (maxsocket+1, &fdreads, &fdwrites, &fderrors, &tv);
                                                                   ^
em.cpp: In member function ‘bool EventMachine_t::_RunSelectOnce()’:
em.cpp:951:40: error: ‘rb_thread_select’ was not declared in this scope
      EmSelect (0, NULL, NULL, NULL, &tv);
                                        ^
Makefile:229: recipe for target 'em.o' failed
make: *** [em.o] Error 1

make failed, exit code 2

Gem files will remain installed in /usr/local/rvm/gems/ruby-2.2.0@veewee/gems/eventmachine-1.0.0.beta.3 for inspection.
Results logged to /usr/local/rvm/gems/ruby-2.2.0@veewee/extensions/x86_64-linux/2.2.0/eventmachine-1.0.0.beta.3/gem_make.out
An error occurred while installing eventmachine (1.0.0.beta.3), and Bundler
cannot continue.
Make sure that `gem install eventmachine -v '1.0.0.beta.3'` succeeds before
bundling.

This problem is already known here : https://github.com/eventmachine/eventmachine/issues/509

I created a Dockerfile to quicly reproduce the issue if you want :

FROM partlab/ubuntu

# install RVM
RUN gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 && \
    \curl -sSL https://get.rvm.io | bash -s stable && \
    echo "source /etc/profile.d/rvm.sh" > /root/.bashrc && \
    gpasswd -a root rvm

# install veewee
RUN bash -ci 'rvm install ruby'
RUN git clone https://github.com/jedi4ever/veewee.git /root/veewee
WORKDIR /root/veewee
RUN bash -ci 'rvm use ruby@veewee --create && \
    gem install bundler && \
    bundle install'

Can you fix it please ?

Thanks !

mpapis commented 9 years ago

try changing https://github.com/jedi4ever/veewee/blob/master/Gemfile#L16 to be just

gem "em-winrm"

and run bundle update em-winrm - if that works open a pull request with it