Error installing eventmachine 0.12.10 #1051

Closed
atoponce opened this Issue Jul 7, 2012 · 19 comments
@atoponce

Following the instructions per https://github.com/gitlabhq/gitlabhq/blob/master/doc/installation.md. This is a Debian GNU/Linux sid installation. The only place I did not follow the doc, is installing Ruby 1.9.3 p194. I used apt-get(8) instead of grabbing the tarball, seeing as though Debian Sid has the version you specify in the installation doc:

$ sudo aptitude versions ruby1.9.3
Package ruby1.9.3:
i   1.9.3.194-1

My error comes from Step 4, installing Gems. I followed the instructions for using SQLite.

$ sudo -u gitlab -H bundle install --without development test --deployment
[...snip...]
Installing eventmachine (0.12.10) with native extensions 
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

        /usr/bin/ruby1.9.1 extconf.rb 
checking for rb_trap_immediate in ruby.h,rubysig.h... no
checking for rb_thread_blocking_region()... yes
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
compiling pipe.cpp
compiling cmain.cpp
compiling epoll.cpp
compiling kb.cpp
kb.cpp: In member function ‘virtual void KeyboardDescriptor::Read()’:
kb.cpp:79:27: warning: ignoring return value of ‘ssize_t read(int, void*, size_t)’, declared with attribute warn_unused_result [ Wunused-result]
compiling files.cpp
compiling ed.cpp
ed.cpp: In member function ‘virtual int ConnectionDescriptor::SendOutboundData(const char*, int)’:
ed.cpp:503:76: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
ed.cpp: In member function ‘void ConnectionDescriptor::_WriteOutboundData()’:
ed.cpp:956:67: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
compiling page.cpp
compiling ssl.cpp
compiling sigs.cpp
compiling binder.cpp
compiling emwin.cpp
compiling cplusplus.cpp
compiling rubymain.cpp
rubymain.cpp: In function ‘VALUE t_connect_server(VALUE, VALUE, VALUE)’:
rubymain.cpp:468:42: error: format not a string literal and no format arguments [-Werror=format-security]
rubymain.cpp: In function ‘VALUE t_bind_connect_server(VALUE, VALUE, VALUE, VALUE, VALUE)’:
rubymain.cpp:488:42: error: format not a string literal and no format arguments [-Werror=format-security]
cc1plus: some warnings being treated as errors
make: *** [rubymain.o] Error 1


Gem files will remain installed in /home/gitlab/gitlab/vendor/bundle/ruby/1.9.1/gems/eventmachine-0.12.10 for inspection.
Results logged to /home/gitlab/gitlab/vendor/bundle/ruby/1.9.1/gems/eventmachine-0.12.10/ext/gem_make.out
An error occured while installing eventmachine (0.12.10), and Bundler cannot continue.
Make sure that `gem install eventmachine -v '0.12.10'` succeeds before bundling.
@neersighted

I found I had to get a login shell: enable login (change the shell) for the 'gitlab' user, then sudo su github, then bash -l. After that, it compiled fine. For some reason, bundler wants a login shell.

@vsizov

Follow the instruction

@vsizov vsizov closed this Jul 9, 2012
@atoponce

I am following the instructions. I already mentioned that.

@atoponce

Even getting a new login shell, I get the same error:

rubymain.cpp: In function ‘VALUE t_connect_server(VALUE, VALUE, VALUE)’:
rubymain.cpp:468:42: error: format not a string literal and no format arguments [-Werror=format-security]
rubymain.cpp: In function ‘VALUE t_bind_connect_server(VALUE, VALUE, VALUE, VALUE, VALUE)’:
rubymain.cpp:488:42: error: format not a string literal and no format arguments [-Werror=format-security]
cc1plus: some warnings being treated as errors
make: *** [rubymain.o] Error 1


Gem files will remain installed in /home/gitlab/gitlab/vendor/bundle/ruby/1.9.1/gems/eventmachine-0.12.10 for inspection.
Results logged to /home/gitlab/gitlab/vendor/bundle/ruby/1.9.1/gems/eventmachine-0.12.10/ext/gem_make.out
An error occured while installing eventmachine (0.12.10), and Bundler cannot continue.
Make sure that `gem install eventmachine -v '0.12.10'` succeeds before bundling.

I'm open to suggestions, because where I'm sitting either the docs are incomplete, or there is a bug. Should I reopen the issue?

@superbobry

I think you removing -Werror from you $CCFLAGS might help.

@vsizov

I am following the instructions. I already mentioned that.

The only place I did not follow the doc, is installing Ruby 1.9.3 p194.

cool

@atoponce

@superbobry Nope, unfortunately. It doesn't help any

@vsizov Isn't Ruby 1.9.3p194 supposed to be installed? Aside from that, this seems to be a C++ error, not a Ruby one. Unless I'm missing something.

@atoponce

More updates trying to get this installed:

# ruby -v
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]
# gem -v
1.8.23
# gem install eventmachine -v '0.12.10'
Building native extensions.  This could take a while...
ERROR:  Error installing eventmachine:
        ERROR: Failed to build gem native extension.

        /usr/bin/ruby1.9.1 extconf.rb
checking for rb_trap_immediate in ruby.h,rubysig.h... no
checking for rb_thread_blocking_region()... yes
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
compiling pipe.cpp
compiling cmain.cpp
compiling epoll.cpp
compiling kb.cpp
kb.cpp: In member function ‘virtual void KeyboardDescriptor::Read()’:
kb.cpp:79:27: warning: ignoring return value of ‘ssize_t read(int, void*, size_t)’, declared with attribute warn_unused_result [-Wunused-result]
compiling files.cpp
compiling ed.cpp
ed.cpp: In member function ‘virtual int ConnectionDescriptor::SendOutboundData(const char*, int)’:
ed.cpp:503:76: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
ed.cpp: In member function ‘void ConnectionDescriptor::_WriteOutboundData()’:
ed.cpp:956:67: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
compiling page.cpp
compiling ssl.cpp
compiling sigs.cpp
compiling binder.cpp
compiling emwin.cpp
compiling cplusplus.cpp
compiling rubymain.cpp
rubymain.cpp: In function ‘VALUE t_connect_server(VALUE, VALUE, VALUE)’:
rubymain.cpp:468:42: error: format not a string literal and no format arguments [-Werror=format-security]
rubymain.cpp: In function ‘VALUE t_bind_connect_server(VALUE, VALUE, VALUE, VALUE, VALUE)’:
rubymain.cpp:488:42: error: format not a string literal and no format arguments [-Werror=format-security]
cc1plus: some warnings being treated as errors
make: *** [rubymain.o] Error 1


Gem files will remain installed in /var/lib/gems/1.9.1/gems/eventmachine-0.12.10 for inspection.
Results logged to /var/lib/gems/1.9.1/gems/eventmachine-0.12.10/ext/gem_make.out
@markba

Same error here. Any update?

@vsizov

try to use rvm or rbenv. Don't spend your time.

@bgw

This is apparently a known issue with eventmachine that has been fixed in their git version. You can force bundler to use the git version by adding this line to the Gemfile:

gem "eventmachine", :git => "https://github.com/eventmachine/eventmachine.git"

You can then run:

bundler install --no-deployment

to override the Gemfile.lock.

@avsej

Or a bit less hardcore:

gem "eventmachine", "~> 1.0.0.rc.4"
@enrico

without requiring the changes to Gemfile: use the bundle config to pass arguments for gem compilation (I found out thin also requires this on a new ubuntu 12.04 LTS box)

sudo -u gitlab -H bundle config build.eventmachine --with-cflags=\"-O2 -pipe -march=native -w\"
sudo -u gitlab -H bundle config build.thin --with-cflags=\"-O2 -pipe -march=native -w\"
@neersighted

👍 to @enrico's solution!

@willyum

Thanks @enrico!

@jotterlei

On my Ubuntu machine, I found this command worked for me

apt-get install build-essential

Found from:
http://stackoverflow.com/questions/4735303/failed-to-install-gem-install-eventmachine-i-need-starling-in-my-project-fo

@oodograss

Thanks @enrico

@krainboltgreene krainboltgreene pushed a commit that referenced this issue Jun 14, 2014
@shtirlic shtirlic Update thin closes #1765 and maybe #1051
Former-commit-id: 4abf5d0
3754569
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment