I'm trying to run bundle install using ubuntu 20.04, rvm with ruby 2.7.2, and I can't get the eventmachine gem to install.
After googling for hours I couldn't find a solution that works for me. I've tried deleting the lockfile and running bundle, ruby-dev is already installed with the latest version, I've tried running bundle with ruby 2.6.6, updating bundle, updating Jekyll from 4.0.0 to 4.2.0, and no matter what I try I'm still getting these error messages I don't understand, so any help would be VERY appreciated!
Gemfile
source 'https://rubygems.org'
gem 'jekyll', '4.0.0'
group :jekyll_plugins do
gem 'jekyll-feed', '0.12.1'
gem 'jekyll-paginate', '1.1.0'
gem 'jekyll-seo-tag', '2.6.1'
gem 'jekyll-sitemap', '1.3.1'
end
Relevant bundle log
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /home/jordan/Programming/galblog/vendor/bundle/ruby/2.7.0/gems/eventmachine-1.2.7/ext
/home/jordan/.rvm/rubies/ruby-2.7.2/bin/ruby -I /home/jordan/.rvm/rubies/ruby-2.7.2/lib/ruby/2.7.0 -r ./siteconf20210214-26199-1f75y70.rb extconf.rb
checking for -lcrypto... yes
checking for -lssl... yes
checking for openssl/ssl.h... yes
checking for openssl/err.h... yes
checking for rb_trap_immediate in ruby.h,rubysig.h... no
checking for rb_thread_blocking_region()... no
checking for rb_thread_call_without_gvl() in ruby/thread.h... yes
checking for rb_thread_fd_select()... yes
checking for rb_fdset_t in ruby/intern.h... yes
checking for rb_wait_for_single_fd()... yes
checking for rb_enable_interrupt()... no
checking for rb_time_new()... yes
checking for inotify_init() in sys/inotify.h... yes
checking for writev() in sys/uio.h... yes
checking for pipe2() in unistd.h... yes
checking for accept4() in sys/socket.h... yes
checking for SOCK_CLOEXEC in sys/socket.h... yes
checking for sys/event.h... no
checking for epoll_create() in sys/epoll.h... yes
checking for clock_gettime()... yes
checking for CLOCK_MONOTONIC_RAW in time.h... yes
checking for CLOCK_MONOTONIC in time.h... yes
CXXFLAGS=-g -O2 -Wall -Wextra -Wno-deprecated-declarations -Wno-ignored-qualifiers -Wno-unused-result -Wno-address
creating Makefile
current directory: /home/jordan/Programming/galblog/vendor/bundle/ruby/2.7.0/gems/eventmachine-1.2.7/ext
make "DESTDIR=" clean
current directory: /home/jordan/Programming/galblog/vendor/bundle/ruby/2.7.0/gems/eventmachine-1.2.7/ext
make "DESTDIR="
compiling binder.cpp
compiling cmain.cpp
compiling ed.cpp
compiling em.cpp
em.cpp: In member function ‘void EventMachine_t::SignalLoopBreaker()’:
em.cpp:316:14: warning: ignoring return value of ‘ssize_t write(int, const void*, size_t)’, declared with attribute warn_unused_result [-Wunused-result]
316 | (void)write (LoopBreakerWriter, "", 1);
| ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
em.cpp: In member function ‘void EventMachine_t::_ReadLoopBreaker()’:
em.cpp:1109:13: warning: ignoring return value of ‘ssize_t read(int, void*, size_t)’, declared with attribute warn_unused_result [-Wunused-result]
1109 | (void)read (LoopBreakerReader, buffer, sizeof(buffer));
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compiling kb.cpp
kb.cpp: In member function ‘virtual void KeyboardDescriptor::Read()’:
kb.cpp:77:13: warning: ignoring return value of ‘ssize_t read(int, void*, size_t)’, declared with attribute warn_unused_result [-Wunused-result]
77 | (void)read (GetSocket(), &c, 1);
| ~~~~~^~~~~~~~~~~~~~~~~~~~
compiling page.cpp
compiling pipe.cpp
compiling rubymain.cpp
rubymain.cpp: In function ‘void event_callback_wrapper(uintptr_t, int, const char*, long unsigned int)’:
rubymain.cpp:220:105: warning: ‘VALUE ruby::backward::cxxanyargs::rb_rescue(VALUE (*)(...), VALUE, VALUE (*)(...), VALUE)’ is deprecated: Use of ANYARGS in this function is deprecated
[-Wdeprecated-declarations]
220 | rb_rescue((VALUE (*)(ANYARGS))event_callback, (VALUE)&e, (VALUE (*)(ANYARGS))event_error_handler, Qnil);
| ^
In file included from /home/jordan/.rvm/rubies/ruby-2.7.2/include/ruby-2.7.0/ruby/ruby.h:2863,
from /home/jordan/.rvm/rubies/ruby-2.7.2/include/ruby-2.7.0/ruby.h:33,
from em.h:24,
from project.h:168,
from rubymain.cpp:20:
/home/jordan/.rvm/rubies/ruby-2.7.2/include/ruby-2.7.0/ruby/backward/cxxanyargs.hpp:198:1: note: declared here
198 | rb_rescue(type *q, VALUE w, type *e, VALUE r)
| ^~~~~~~~~
rubymain.cpp:220:105: warning: ‘VALUE ruby::backward::cxxanyargs::rb_rescue(VALUE (*)(...), VALUE, VALUE (*)(...), VALUE)’ is deprecated: Use of ANYARGS in this function is deprecated
[-Wdeprecated-declarations]
220 | rb_rescue((VALUE (*)(ANYARGS))event_callback, (VALUE)&e, (VALUE (*)(ANYARGS))event_error_handler, Qnil);
| ^
In file included from /home/jordan/.rvm/rubies/ruby-2.7.2/include/ruby-2.7.0/ruby/ruby.h:2863,
from /home/jordan/.rvm/rubies/ruby-2.7.2/include/ruby-2.7.0/ruby.h:33,
from em.h:24,
from project.h:168,
from rubymain.cpp:20:
/home/jordan/.rvm/rubies/ruby-2.7.2/include/ruby-2.7.0/ruby/backward/cxxanyargs.hpp:198:1: note: declared here
198 | rb_rescue(type *q, VALUE w, type *e, VALUE r)
| ^~~~~~~~~
compiling ssl.cpp
linking shared-object rubyeventmachine.so
current directory: /home/jordan/Programming/galblog/vendor/bundle/ruby/2.7.0/gems/eventmachine-1.2.7/ext
make "DESTDIR=" install
make: /usr/bin/mkdir: Command not found
make: *** [Makefile:202: .sitearchdir.time] Error 127
make install failed, exit code 2
Gem files will remain installed in /home/jordan/Programming/galblog/vendor/bundle/ruby/2.7.0/gems/eventmachine-1.2.7 for inspection.
Results logged to /home/jordan/Programming/galblog/vendor/bundle/ruby/2.7.0/extensions/x86_64-linux/2.7.0/eventmachine-1.2.7/gem_make.out
An error occurred while installing eventmachine (1.2.7), and Bundler cannot continue.
Make sure that `gem install eventmachine -v '1.2.7' --source 'https://rubygems.org/'` succeeds before bundling.
In Gemfile:
jekyll-feed was resolved to 0.12.1, which depends on
jekyll was resolved to 4.0.0, which depends on
em-websocket was resolved to 0.5.2, which depends on
eventmachine
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /home/jordan/Programming/galblog/vendor/bundle/ruby/2.7.0/gems/http_parser.rb-0.6.0/ext/ruby_http_parser
/home/jordan/.rvm/rubies/ruby-2.7.2/bin/ruby -I /home/jordan/.rvm/rubies/ruby-2.7.2/lib/ruby/2.7.0 -r ./siteconf20210214-26199-8qwb9v.rb extconf.rb
creating Makefile
current directory: /home/jordan/Programming/galblog/vendor/bundle/ruby/2.7.0/gems/http_parser.rb-0.6.0/ext/ruby_http_parser
make "DESTDIR=" clean
current directory: /home/jordan/Programming/galblog/vendor/bundle/ruby/2.7.0/gems/http_parser.rb-0.6.0/ext/ruby_http_parser
make "DESTDIR="
compiling ruby_http_parser.c
compiling ryah_http_parser.c
linking shared-object ruby_http_parser.so
current directory: /home/jordan/Programming/galblog/vendor/bundle/ruby/2.7.0/gems/http_parser.rb-0.6.0/ext/ruby_http_parser
make "DESTDIR=" install
make: /usr/bin/mkdir: Command not found
make: *** [Makefile:202: .sitearchdir.time] Error 127
make install failed, exit code 2
Gem files will remain installed in /home/jordan/Programming/galblog/vendor/bundle/ruby/2.7.0/gems/http_parser.rb-0.6.0 for inspection.
Results logged to /home/jordan/Programming/galblog/vendor/bundle/ruby/2.7.0/extensions/x86_64-linux/2.7.0/http_parser.rb-0.6.0/gem_make.out
An error occurred while installing http_parser.rb (0.6.0), and Bundler cannot continue.
Make sure that `gem install http_parser.rb -v '0.6.0' --source 'https://rubygems.org/'` succeeds before bundling.
In Gemfile:
jekyll-feed was resolved to 0.12.1, which depends on
jekyll was resolved to 4.0.0, which depends on
em-websocket was resolved to 0.5.2, which depends on
http_parser.rb
I tried again, this time using ruby 2.7.1 instead of 2.7.2 and it worked.
I guess some update in ruby broke it, so for anyone stuck on this try using 2.7.1 or not the latest version of ruby.
I'm getting an error installing syck on Ubuntu 15.04. Building the native extensions fails:
Installing syck 1.0.1 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/home/markus/.rvm/rubies/ruby-2.2.1/bin/ruby -r ./siteconf20150618-8242-1z0c5iw.rb extconf.rb
checking for st.h... yes
creating Makefile
make "DESTDIR=" clean
make "DESTDIR="
compiling bytecode.c
compiling implicit.c
compiling token.c
token.re: In function ‘sycklex_yaml_utf8’:
token.re:541:36: warning: variable ‘lvl’ set but not used [-Wunused-but-set-variable]
compiling rubyext.c
rubyext.c:31:20: error: field ‘hash’ has incomplete type
struct RHash hash;
^
rubyext.c: In function ‘syck_seq_initialize’:
rubyext.c:1529:15: warning: variable ‘node’ set but not used [-Wunused-but-set-variable]
SyckNode *node;
^
Makefile:237: recipe for target 'rubyext.o' failed
make: *** [rubyext.o] Error 1
make failed, exit code 2
Gem files will remain installed in /home/markus/.rvm/gems/ruby-2.2.1#mygemset/gems/syck-1.0.1 for inspection.
Results logged to /home/markus/.rvm/gems/ruby-2.2.1#mygemset/extensions/x86_64-linux/2.2.0/syck-1.0.1/gem_make.out
An error occurred while installing syck (1.0.1), and Bundler cannot continue.
Make sure that `gem install syck -v '1.0.1'` succeeds before bundling.
Does someone have an idea what the issue is and how to fix it?
I have an error message while running sudo bundle install:
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb
checking for ruby/util.h... yes
creating Makefile
make "DESTDIR=" clean
make "DESTDIR="
compiling bcrypt_ext.c
compiling crypt.c
compiling crypt_blowfish.c
compiling crypt_gensalt.c
compiling wrapper.c
linking shared-object bcrypt_ext.bundle
clang: error: unknown argument: '-multiply_definedsuppress' [-Wunused-command-line-argument-hard-error-in-future]
clang: note: this will be a hard error (cannot be downgraded to a warning) in the future
make: *** [bcrypt_ext.bundle] Error 1
make failed, exit code 2
Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/bcrypt-3.1.7 for inspection.
Results logged to /Library/Ruby/Gems/2.0.0/extensions/universal-darwin-13/2.0.0/bcrypt-3.1.7/gem_make.out
An error occurred while installing bcrypt (3.1.7), and Bundler cannot continue.
Make sure that `gem install bcrypt -v '3.1.7'` succeeds before bundling.
Then I tried to run sudo gem install bcrypt -v '3.1.7' and have below error message:
Building native extensions. This could take a while...
ERROR: Error installing bcrypt:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb
checking for ruby/util.h... yes
creating Makefile
make "DESTDIR=" clean
make "DESTDIR="
compiling bcrypt_ext.c
compiling crypt.c
compiling crypt_blowfish.c
compiling crypt_gensalt.c
compiling wrapper.c
linking shared-object bcrypt_ext.bundle
clang: error: unknown argument: '-multiply_definedsuppress' [-Wunused-command-line-argument-hard-error-in-future]
clang: note: this will be a hard error (cannot be downgraded to a warning) in the future
make: *** [bcrypt_ext.bundle] Error 1
make failed, exit code 2
Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/bcrypt-3.1.7 for inspection.
Results logged to /Library/Ruby/Gems/2.0.0/extensions/universal-darwin-13/2.0.0/bcrypt-3.1.7/gem_make.out
After this, I try to run sudo gem install bcrypt, still not working. Any tips?
I had upgraded Xcode from the Mac App Store, and that caused this particular error for me.
The way to fix it in my case: run Xcode and accept the license terms, etc. Then when I ran bundle install, it compiled and installed bcrypt just fine.
I'm new to Ruby and tried installing the oj gem with the following command:
sudo gem install oj -v '2.1.6'
Unfortunately I have received the following error. Is this due to using Ruby 2.0? Are there any workarounds?
ERROR: Error installing oj:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb
>>>>> Creating Makefile for ruby version 2.0.0 on universal.x86_64-darwin13 <<<<<
creating Makefile
make "DESTDIR="
compiling cache8.c
compiling circarray.c
compiling compat.c
compiling dump.c
dump.c:165:1: warning: unused function 'ulong2str' [-Wunused-function]
ulong2str(uint32_t num, char *end) {
^
1 warning generated.
compiling err.c
compiling fast.c
fast.c:151:1: warning: unused function 'next_white' [-Wunused-function]
next_white(ParseInfo pi) {
^
1 warning generated.
compiling hash.c
compiling hash_test.c
compiling object.c
compiling odd.c
compiling oj.c
compiling parse.c
compiling resolve.c
compiling saj.c
saj.c:130:1: warning: unused function 'next_white' [-Wunused-function]
next_white(ParseInfo pi) {
^
1 warning generated.
compiling scp.c
compiling strict.c
compiling val_stack.c
linking shared-object oj.bundle
clang: error: unknown argument: '-multiply_definedsuppress' [-Wunused-command-line-argument-hard-error-in-future]
clang: note: this will be a hard error (cannot be downgraded to a warning) in the future
make: *** [oj.bundle] Error 1
Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/oj-2.1.6 for inspection.
This issue is due to Xcode 5.1 - its already reported as a bug to Ruby.
https://bugs.ruby-lang.org/issues/9624#change-45736
There is some more additional discussion here:
Ruby Gem install Json fails on Mavericks and Xcode 5.1 - unknown argument: '-multiply_definedsuppress'
I have Ruby version manager RVM on OSC Mavericks with MacPorts. I was trying to update WPScan that runs on ruby. I was trying to do an update:
ruby wpscan.rb --update
when I run into this error:
Could not find gem 'typhoeus (>= 0.6.3) ruby' in the gems available on this machine.
I had this error before. So a ran bundle install. Then I ran into other errors:
sudo bundle install
Fetching gem metadata from https://rubygems.org/.........
Fetching gem metadata from https://rubygems.org/..
Installing ffi (1.9.3) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/Users/jasper/.rvm/rubies/ruby-1.9.3-p362/bin/ruby extconf.rb
checking for ffi_call() in -lffi... yes
-----------------cut ----------------
checking for ffi_prep_cif_var()... yes
creating extconf.h
creating Makefile
make
compiling AbstractMemory.c
compiling ArrayType.c
compiling Buffer.c
compiling Call.c
Call.c:303:5: warning: implicit declaration of function 'rb_thread_call_without_gvl' is invalid in C99 [-Wimplicit-function-declaration]
rbffi_thread_blocking_region(call_blocking_function, data, (void *) -1, NULL);
^
./Thread.h:78:39: note: expanded from macro 'rbffi_thread_blocking_region'
# define rbffi_thread_blocking_region rb_thread_call_without_gvl
^
1 warning generated.
compiling ClosurePool.c
compiling DataConverter.c
compiling DynamicLibrary.c
compiling ffi.c
compiling Function.c
Function.c:479:33: warning: incompatible pointer types passing 'VALUE (void *)' to parameter of type 'void *(*)(void *)' [-Wincompatible-pointer-types]
rb_thread_call_with_gvl(callback_with_gvl, &cb);
^~~~~~~~~~~~~~~~~
Function.c:102:46: note: passing argument to parameter 'func' here
extern void *rb_thread_call_with_gvl(void *(*func)(void *), void *data1);
^
Function.c:563:9: warning: implicit declaration of function 'rb_thread_call_without_gvl' is invalid in C99 [-Wimplicit-function-declaration]
rb_thread_call_without_gvl(async_cb_wait, &w, async_cb_stop, &w);
^
Function.c:738:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
3 warnings generated.
compiling FunctionInfo.c
compiling LastError.c
compiling LongDouble.c
compiling MappedType.c
compiling MemoryPointer.c
compiling MethodHandle.c
compiling Platform.c
compiling Pointer.c
compiling Struct.c
compiling StructByReference.c
compiling StructByValue.c
compiling StructLayout.c
compiling Thread.c
compiling Type.c
compiling Types.c
compiling Variadic.c
linking shared-object ffi_c.bundle
make install
make: /opt/local/bin/gmkdir: No such file or directory
make: [/Users/jasper/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/gems/1.9.1/gems/ffi-1.9.3/lib/ffi_c.bundle] Error 1 (ignored)
/opt/local/bin/ginstall -c -m 0755 ffi_c.bundle /Users/jasper/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/gems/1.9.1/gems/ffi-1.9.3/lib
make: /opt/local/bin/ginstall: No such file or directory
make: *** [/Users/jasper/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/gems/1.9.1/gems/ffi-1.9.3/lib/ffi_c.bundle] Error 1
Gem files will remain installed in /Users/jasper/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/gems/1.9.1/gems/ffi-1.9.3 for inspection.
Results logged to /Users/jasper/.rvm/rubies/ruby-1.9.3-p362/lib/ruby/gems/1.9.1/gems/ffi-1.9.3/ext/ffi_c/gem_make.out
An error occurred while installing ffi (1.9.3), and Bundler cannot continue.
Make sure that `gem install ffi -v '1.9.3'` succeeds before bundling.
I do have /opt/local/bin/gmdir. I added it myself, but the error remains and then there are some warnings and errors concerning other directories that not seem to exist. why does the script does not create them? Any easy way around these errors so I can ran my favourite WP scanner?
NB I thought RVM would work without MacPorts... But it is looking for directories in MacPorts.
gmkdir is a part of GNU Core Utilities.
You can install them with command sudo port install coreutils.