Note: I'm running Ubuntu, not Windows.
This is what happens when trying to install kgio. Am I missing dependencies, what do I install?
gilani#debris$ gem install kgio -v '2.8.1'
Building native extensions. This could take a while...
ERROR: Error installing kgio:
ERROR: Failed to build gem native extension.
/home/gilani/.rvm/rubies/ruby-2.2.1/bin/ruby -r ./siteconf20151218-13133-1dvzrlz.rb extconf.rb
checking for CLOCK_MONOTONIC in time.h... yes
checking for clockid_t in time.h... yes
checking for clock_gettime() in -lrt... yes
checking for t_open() in -lnsl... no
checking for socket() in -lsocket... no
checking for poll() in poll.h... yes
checking for getaddrinfo() in sys/types.h,sys/socket.h,netdb.h... yes
checking for getnameinfo() in sys/types.h,sys/socket.h,netdb.h... yes
checking for struct sockaddr_storage in sys/types.h,sys/socket.h... yes
checking for accept4() in sys/socket.h... yes
checking for sys/select.h... yes
checking for writev() in sys/uio.h... yes
checking for ruby/io.h... yes
checking for rb_io_t.fd in ruby.h,ruby/io.h... yes
checking for rb_io_t.mode in ruby.h,ruby/io.h... yes
checking for rb_io_t.pathv in ruby.h,ruby/io.h... yes
checking for struct RFile in ruby.h,ruby/io.h... yes
checking size of struct RFile in ruby.h,ruby/io.h... 24
checking for struct RObject... yes
checking size of struct RObject... 40
checking size of int... 4
checking for rb_io_ascii8bit_binmode()... yes
checking for rb_update_max_fd()... yes
checking for rb_fd_fix_cloexec()... yes
checking for rb_cloexec_open()... yes
checking for rb_thread_blocking_region()... no
checking for rb_thread_io_blocking_region()... yes
checking for rb_str_set_len()... yes
checking for rb_time_interval()... yes
checking for rb_wait_for_single_fd()... yes
checking for rb_str_subseq()... yes
checking for rb_ary_subseq()... yes
creating Makefile
make "DESTDIR=" clean
make "DESTDIR="
compiling wait.c
compiling autopush.c
compiling tryopen.c
tryopen.c:42:0: warning: "RUBY_UBF_IO" redefined [enabled by default]
# define RUBY_UBF_IO ((void *)(-1))
^
In file included from /home/gilani/.rvm/rubies/ruby-2.2.1/include/ruby-2.2.0/ruby/ruby.h:1710:0,
from /home/gilani/.rvm/rubies/ruby-2.2.1/include/ruby-2.2.0/ruby.h:33,
from tryopen.c:1:
/home/gilani/.rvm/rubies/ruby-2.2.1/include/ruby-2.2.0/ruby/intern.h:902:0: note: this is the location of the previous definition
#define RUBY_UBF_IO ((rb_unblock_function_t *)-1)
^
In file included from tryopen.c:43:0:
/home/gilani/.rvm/rubies/ruby-2.2.1/include/ruby-2.2.0/ruby/backward/rubysig.h:14:2: warning: #warning rubysig.h is obsolete [-Wcpp]
#warning rubysig.h is obsolete
^
tryopen.c: In function ‘my_thread_blocking_region’:
tryopen.c:52:2: error: ‘TRAP_BEG’ undeclared (first use in this function)
TRAP_BEG; /* for FIFO */
^
tryopen.c:52:2: note: each undeclared identifier is reported only once for each function it appears in
tryopen.c:54:2: error: ‘TRAP_END’ undeclared (first use in this function)
TRAP_END;
^
make: *** [tryopen.o] Error 1
make failed, exit code 2
Gem files will remain installed in /home/gilani/.rvm/gems/ruby-2.2.1/gems/kgio-2.8.1 for inspection.
Results logged to /home/gilani/.rvm/gems/ruby-2.2.1/extensions/x86_64-linux/2.2.0/kgio-2.8.1/gem_make.out
As #bjhaid answered in the comments, and didn't follow up. I'll post it here myself to close the questoin:
you are trying to compile the gem against a version of ruby newer than
what it was written against, kgio 2.8.1 was released in
2013(bogomips.org/kgio.git/tag/?h=v2.8.1), ruby 2.2.1 was released
March 2015 (ruby-lang.org/en/news/2015/03/03/ruby-2-2-1-released)
A combination of these helped me on Ubuntu 16.04:
apt-get install ruby-kgio
bundle update kgio
Found that if you rvm is not loaded, you might receive same error.
to verify if rvm is loaded try:
rvm use 2.x.x
if you receive following warning:
You need to change your terminal emulator preferences to allow login
shell. Sometimes it is required to use /bin/bash --login as the
command. Please visit https://rvm.io/integration/gnome-terminal/ for
an example.
This would probably be also your case :-)
/bin/bash --login
rvm use 2.x.x
Solved for me after banging head for about an hour+ why could this happens
Related
Helle everyone,
I am trying to install the eventmachine gem in a project after it fails during a bundle install.
gem install eventmachine -v '1.0.5'
Logs:
Building native extensions. This could take a while...
ERROR: Error installing eventmachine:
ERROR: Failed to build gem native extension.
/Users/studiohb/.rvm/rubies/ruby-2.1.2/bin/ruby extconf.rb
checking for rb_trap_immediate in ruby.h,rubysig.h... no
checking for rb_thread_blocking_region()... yes
checking for ruby/thread.h... yes
checking for rb_thread_call_without_gvl() in ruby/thread.h... yes
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_thread_fd_select()... 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
checking for clock_gettime()... no
checking for gethrtime()... no
creating Makefile
make "DESTDIR=" clean
make "DESTDIR="
compiling binder.cpp
In file included from binder.cpp:20:
./project.h:116:10: fatal error: 'openssl/ssl.h' file not found
#include <openssl/ssl.h>
^
1 error generated.
make: *** [binder.o] Error 1
make failed, exit code 2
Gem files will remain installed in /Users/studiohb/.rvm/gems/ruby-2.1.2#regiex/gems/eventmachine-1.0.5 for inspection.
Results logged to /Users/studiohb/.rvm/gems/ruby-2.1.2#regiex/extensions/x86_64-darwin-13/2.1.0-static/eventmachine-1.0.5/gem_make.out
So I believe that this is a SSL certificat issue si I tried :
brew link --force openssl
logs :
Warning: Refusing to link: openssl
Linking keg-only openssl means you may end up linking against the insecure,
deprecated system OpenSSL while using the headers from Homebrew's openssl.
Instead, pass the full include/library paths to your compiler e.g.:
Do you guys have any ideas on going around this error ?
In trying to install the nio4r gem. I tried
gem install nio4r -v '1.0.0'
The error that pops up is:
Building native extensions. This could take a while...
ERROR: Error installing nio4r:
ERROR: Failed to build gem native extension.
/.rvm/rubies/ruby-2.2.1/bin/ruby -r ./siteconf20150406-11564-1qtifmf.rb extconf.rb
checking for rb_thread_blocking_region()... no
checking for sys/select.h... yes
checking for poll.h... yes
checking for sys/epoll.h... no
checking for sys/event.h... yes
checking for sys/queue.h... yes
checking for port.h... no
checking for sys/resource.h... yes
creating Makefile
make "DESTDIR=" clean
make "DESTDIR="
compiling monitor.c
In file included from monitor.c:6:
In file included from ./nio4r.h:10:
/.rvm/rubies/ruby-2.2.1/include/ruby-2.2.0/ruby/backward/rubyio.h:2:2: warning: use "ruby/io.h" instead of "rubyio.h" [-W#warnings]
warning use "ruby/io.h" instead of "rubyio.h"
...
What am I getting wrong? Is it an issue with my RVM?
With some basic updates, I was able to get it to work.
bundle update
and then
bundle
installs the gem.
Thanks to https://github.com/celluloid/nio4r/issues/46
Another approach would be to install a later version of ruby with RVM and do bundle again. Both works
This question already has answers here:
Eventmachine gem install fail
(9 answers)
Closed 8 years ago.
A package containing a bundle of a lot of technologies was delivered to me. When i try install the bundle using bundle install --local there is an error displayed that the eventmachine was not installed properly and suggests that the gem install eventmachine -v '1.0.3' should be run. When i do that the folloing message is shown:
$ gem install eventmachine
Fetching: eventmachine-1.0.3.gem (100%)
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error
installing eventmachine:
ERROR: Failed to build gem native extension.
c:/Ruby200-x64/bin/ruby.exe extconf.rb
checking for main() in -lssl... no
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... no
checking for __NR_inotify_init in sys/syscall.h... no
checking for writev() in sys/uio.h... no
checking for rb_wait_for_single_fd()... yes
checking for rb_enable_interrupt()... no
checking for rb_time_new()... yes
checking for windows.h... yes
checking for winsock.h... yes
checking for main() in -lkernel32... yes
checking for main() in -lrpcrt4... yes
checking for main() in -lgdi32... yes
creating Makefile
make "DESTDIR="
generating rubyeventmachine-x64-mingw32.def
compiling binder.cpp
In file included from c:\ruby200-x64\devkit\mingw\bin\../lib/gcc/x86_64-w64-ming
w32/4.7.2/../../../../x86_64-w64-mingw32/include/process.h:12:0,
from c:/Ruby200-x64/include/ruby-2.0.0/ruby/win32.h:60,
from c:/Ruby200-x64/include/ruby-2.0.0/ruby/defines.h:153,
from c:/Ruby200-x64/include/ruby-2.0.0/ruby/ruby.h:70,
from c:/Ruby200-x64/include/ruby-2.0.0/ruby.h:33,
from em.h:24,
from project.h:150,
from binder.cpp:20:
c:\ruby200-x64\devkit\mingw\bin\../lib/gcc/x86_64-w64-mingw32/4.7.2/../../../../
x86_64-w64-mingw32/include/sys/types.h:68:16: error: conflicting declaration 'ty
pedef _pid_t pid_t'
In file included from binder.cpp:20:0:
project.h:97:13: error: 'pid_t' has a previous declaration as 'typedef int pid_t
'
In file included from project.h:151:0,
from binder.cpp:20:
ed.h: In member function 'void EventableDescriptor::SetSocketInvalid()':
ed.h:43:40: warning: overflow in implicit constant conversion [-Woverflow]
make: *** [binder.o] Error 1
Gem files will remain installed in c:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/event
machine-1.0.3 for inspection.
Results logged to c:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/eventmachine-1.0.3/ext
/gem_make.out
Inside the gem_make.out the following text is shown:
c:/Ruby200-x64/bin/ruby.exe extconf.rb
checking for main() in -lssl... no
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... no
checking for __NR_inotify_init in sys/syscall.h... no
checking for writev() in sys/uio.h... no
checking for rb_wait_for_single_fd()... yes
checking for rb_enable_interrupt()... no
checking for rb_time_new()... yes
checking for windows.h... yes
checking for winsock.h... yes
checking for main() in -lkernel32... yes
checking for main() in -lrpcrt4... yes
checking for main() in -lgdi32... yes
creating Makefile
make "DESTDIR="
generating rubyeventmachine-x64-mingw32.def
compiling binder.cpp
In file included from c:\ruby200-x64\devkit\mingw\bin\../lib/gcc/x86_64-w64-mingw32/4.7.2/../../../../x86_64-w64-mingw32/include/process.h:12:0,
from c:/Ruby200-x64/include/ruby-2.0.0/ruby/win32.h:60,
from c:/Ruby200-x64/include/ruby-2.0.0/ruby/defines.h:153,
from c:/Ruby200-x64/include/ruby-2.0.0/ruby/ruby.h:70,
from c:/Ruby200-x64/include/ruby-2.0.0/ruby.h:33,
from em.h:24,
from project.h:150,
from binder.cpp:20:
c:\ruby200-x64\devkit\mingw\bin\../lib/gcc/x86_64-w64-mingw32/4.7.2/../../../../x86_64-w64-mingw32/include/sys/types.h:68:16: error: conflicting declaration 'typedef _pid_t pid_t'
In file included from binder.cpp:20:0:
project.h:97:13: error: 'pid_t' has a previous declaration as 'typedef int pid_t'
In file included from project.h:151:0,
from binder.cpp:20:
ed.h: In member function 'void EventableDescriptor::SetSocketInvalid()':
ed.h:43:40: warning: overflow in implicit constant conversion [-Woverflow]
make: *** [binder.o] Error 1
Anyone got a clue of what this might be?
I have installed ruby 2.0.0 with DevKit. Both in the 64 bit version.
The problem was solved with help from the thread that #GraemeMcLean mentions in the comments above ( Eventmachine gem install fail )
This was a weird workaround though, and the authors of the gem should really fix this.
I'm trying to run bundle install before starting a rails server and keep getting this error
An error occurred while installing pg (0.15.1), and Bundler cannot continue.
Make sure that `gem install pg -v '0.15.1'` succeeds before bundling.
Note that I've already tried installing postgres and I've already tried fixing the path to pg_config
Any idea what's going on?
The entire portion of the log reads:
Installing pg (0.15.1) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/usr/local/rvm/rubies/ruby-1.9.3-p392/bin/ruby extconf.rb
checking for pg_config... yes
Using config values from /usr/bin/pg_config
checking for libpq-fe.h... yes
checking for libpq/libpq-fs.h... yes
checking for pg_config_manual.h... yes
checking for PQconnectdb() in -lpq... yes
checking for PQconnectionUsedPassword()... yes
checking for PQisthreadsafe()... yes
checking for PQprepare()... yes
checking for PQexecParams()... yes
checking for PQescapeString()... yes
checking for PQescapeStringConn()... yes
checking for PQescapeLiteral()... yes
checking for PQescapeIdentifier()... yes
checking for PQgetCancel()... yes
checking for lo_create()... yes
checking for pg_encoding_to_char()... yes
checking for pg_char_to_encoding()... yes
checking for PQsetClientEncoding()... yes
checking for PQlibVersion()... yes
checking for PQping()... yes
checking for PQsetSingleRowMode()... no
checking for rb_encdb_alias()... yes
checking for rb_enc_alias()... yes
checking for rb_thread_call_without_gvl()... yes
checking for rb_thread_call_with_gvl()... yes
checking for rb_thread_fd_select()... yes
checking for rb_w32_wrap_io_handle()... no
checking for PGRES_COPY_BOTH in libpq-fe.h... no
checking for PGRES_SINGLE_TUPLE in libpq-fe.h... no
checking for struct pgNotify.extra in libpq-fe.h... yes
checking for unistd.h... yes
checking for ruby/st.h... yes
creating extconf.h
creating Makefile
make
compiling gvl_wrappers.c
compiling pg.c
pg.c: In function ‘Init_pg_ext’:
pg.c:384: error: ‘PQPING_OK’ undeclared (first use in this function)
pg.c:384: error: (Each undeclared identifier is reported only once
pg.c:384: error: for each function it appears in.)
pg.c:386: error: ‘PQPING_REJECT’ undeclared (first use in this function)
pg.c:388: error: ‘PQPING_NO_RESPONSE’ undeclared (first use in this function)
pg.c:390: error: ‘PQPING_NO_ATTEMPT’ undeclared (first use in this function)
make: *** [pg.o] Error 1
Gem files will remain installed in /usr/local/rvm/gems/ruby-1.9.3-p392/gems/pg-0.15.1 for inspection.
Results logged to /usr/local/rvm/gems/ruby-1.9.3-p392/gems/pg-0.15.1/ext/gem_make.out
An error occurred while installing pg (0.15.1), and Bundler cannot continue.
Make sure that `gem install pg -v '0.15.1'` succeeds before bundling.
Questioner did not specify the OS.
On Ubuntu and other Debian flavors, try this:
sudo apt-get install libpq-dev
This should automatically pull in other dependencies if you don't already have them installed.
Looks like dooleyburger's answer is appropriate for various shades of Red Hat.
I'm using CentOS 6.3 and installing both postgres-libs postgres-devel worked for me (per: https://serverfault.com/questions/316703/how-to-install-libpq-dev-on-centos-5-5)
sudo yum install postgresql-libs postgresql-devel
In OS X: I was having this problem for an hour in a fresh Macbook Air, just be sure your xCode is installed and in Preferences > Components > Command Lines Tools , are downloaded.
Then you should be ready to run:
gem install pg -v '0.15.1'
When I run bundle install it stops with:
Installing nokogiri (1.4.3.1) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
I tried installing it manually using "Installing Nokogiri" but this did work out in my favour.
Do I need to change something?
/usr/bin/ruby1.9.1 extconf.rb'
extconf.rb:10: Use RbConfig instead of obsolete and deprecated Config.
checking for libxml/parser.h... yes
checking for libxslt/xslt.h... yes
checking for libexslt/exslt.h... yes
checking for xmlParseDoc() in -lxml2... yes
checking for xsltParseStylesheetDoc() in -lxslt... yes
checking for exsltFuncRegister() in -lexslt... yes
checking for xmlFirstElementChild()... yes
checking for xmlRelaxNGSetParserStructuredErrors()... yes
checking for xmlRelaxNGSetParserStructuredErrors()... yes
checking for xmlRelaxNGSetValidStructuredErrors()... yes
checking for xmlSchemaSetValidStructuredErrors()... yes
checking for xmlSchemaSetParserStructuredErrors()... yes
creating Makefile
Or this:
make
compiling xml_dtd.c
compiling xml_entity_reference.c
compiling xml_sax_parser_context.c
compiling xml_attribute_decl.c
compiling xml_schema.c
compiling xml_processing_instruction.c
compiling xml_cdata.c
compiling xml_xpath_context.c
xml_xpath_context.c: In function ‘xpath_generic_exception_handler’:
xml_xpath_context.c:154:3: error: format not a string literal and no format arguments [- Werror=format-security]
cc1: some warnings being treated as errors
make: *** [xml_xpath_context.o] Error 1
Gem files will remain installed in /home/virinchy/.bundler/tmp/10048/gems/nokogiri- 1.4.3.1 for inspection.
Results logged to /home/virinchy/.bundler/tmp/10048/gems/nokogiri- 1.4.3.1/ext/nokogiri/gem_make.out
An error occured while installing nokogiri (1.4.3.1), and Bundler cannot continue.
Make sure that `gem install nokogiri -v '1.4.3.1'` succeeds before bundling.'
First, Nokogiri 1.4.3.1 is almost three years old. You should upgrade.
Second, please see https://github.com/sparklemotion/nokogiri/issues/680 for details around how Debian hardened the gcc compiler. You will need to use either an older version of debian or a newer version of Nokogiri.