Bundle Install | rdkafka 0.8.1 ERROR: Version string is empty - bundler

I am running bundle install and encountering this error:
Installing rdkafka 0.8.1 with native extensions
ERROR: Error installing rdkafka:
ERROR: Failed to build gem native extension.
checking for strlcpy (by compile)... ok
checking for strerror_r (by compile)... ok
checking for pthread_setname_gnu (by compile)... failed (disable)
checking for pthread_setname_darwin (by compile)... ok
checking for nm (by env NM)... ok (cached)
checking for getrusage (by compile)... ok
###########################################################
### Configure failed ###
###########################################################
### Accumulated failures: ###
###########################################################
parseversion ()
module: parseversion
action: fail
reason:
Version string is empty
Even if I run gem install rdkafka -v '0.8.1' --source 'https://rubygems.org/' it will still give the same error. Thank you in advance!

Related

mysql2 version 0.5.2 Installation Failed [duplicate]

This question already has answers here:
Error when trying to install app with mysql2 gem
(19 answers)
Closed 4 years ago.
I am trying to install mysql2 (version 0.5.2) on My MacBook running OSX 10.14.1 and using Rails 5.2.2. I have already installed it using gem install mysql2 but it wasn't successful, yet it's in my gem file as:
gem 'mysql2'
When I try installing gem mysql2, I am getting the following error:
Fetching mysql2 0.5.2
Installing mysql2 0.5.2 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /Users/lawrence/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/mysql2- 0.5.2/ext/mysql2
/Users/lawrence/.rbenv/versions/2.5.3/bin/ruby -r ./siteconf20181213-11829- 1fv4si0.rb extconf.rb
checking for rb_absint_size()... yes
checking for rb_absint_singlebit_p()... yes
checking for rb_wait_for_single_fd()... yes
-----
Using mysql_config at /usr/local/bin/mysql_config
-----
checking for mysql.h... yes
checking for errmsg.h... yes
checking for SSL_MODE_DISABLED in mysql.h... yes
checking for SSL_MODE_PREFERRED in mysql.h... yes
checking for SSL_MODE_REQUIRED in mysql.h... yes
checking for SSL_MODE_VERIFY_CA in mysql.h... yes
checking for SSL_MODE_VERIFY_IDENTITY in mysql.h... yes
checking for MYSQL.net.vio in mysql.h... yes
checking for MYSQL.net.pvio in mysql.h... no
checking for MYSQL_ENABLE_CLEARTEXT_PLUGIN in mysql.h... yes
checking for SERVER_QUERY_NO_GOOD_INDEX_USED in mysql.h... yes
checking for SERVER_QUERY_NO_INDEX_USED in mysql.h... yes
checking for SERVER_QUERY_WAS_SLOW in mysql.h... yes
checking for MYSQL_OPTION_MULTI_STATEMENTS_ON in mysql.h... yes
checking for MYSQL_OPTION_MULTI_STATEMENTS_OFF in mysql.h... yes
checking for my_bool in mysql.h... no
-----
Don't know how to set rpath on your system, if MySQL libraries are not in path mysql2 may not load
-----
-----
Setting libpath to /usr/local/Cellar/mysql/8.0.12/lib
-----
creating Makefile
current directory: /Users/lawrence/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/mysql2- 0.5.2/ext/mysql2
make "DESTDIR=" clean
current directory: /Users/lawrence/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/mysql2-0.5.2/ext/mysql2
make "DESTDIR="
compiling client.c
compiling infile.c
compiling mysql2_ext.c
compiling result.c
compiling statement.c
linking shared-object mysql2/mysql2.bundle
ld: library not found for -lssl
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [mysql2.bundle] Error 1
make failed, exit code 2
Gem files will remain installed in /Users/lawrence/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/mysql2-0.5.2 for inspection.
Results logged to /Users/lawrence/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/extensions/x86_64- darwin-18/2.5.0-static/mysql2-0.5.2/gem_make.out
An error occurred while installing mysql2 (0.5.2), and Bundler cannot continue.
Make sure that `gem install mysql2 -v '0.5.2' --source 'https://rubygems.org/'` succeeds before bundling.
In Gemfile: mysql2
How can I fix this issue?
I have found the Answer
Mojave changed the location of header files necessary for compiling C extensions. You might need to run the following command to install pg, mysql2, nokogiri, or other gems that require C extensions:
sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /
Follow the link below and find out more.
https://gorails.com/setup/osx/10.14-mojave
ld: library not found for -lssl is the likely culprit.
Try brew install openssl. Also, check out this post for more information.
EDIT: For future users this worked for me facing a similar issue. Make sure you change the -v to whatever version you need. I am on rails 4.2.x so used 0.4.10, Rails 5.x would use 0.5.x.
gem install mysql2 -v '0.4.10' -- --with-ldflags=-L/usr/local/opt/openssl/lib --with-cppflags=-I/usr/local/opt/openssl/include

ERROR: Failed to build gem native extension when installing Sablon gem

I am trying to install and use the Sablon ruby gem. I have installed xcode command line developer tools. However, I continue to get the following error:
ERROR: Error installing sablon:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb
checking if the C compiler accepts ... yes
checking if the C compiler accepts -Wno-error=unused-command-line-argument-hard-error-in-future... no
Building nokogiri using packaged libraries.
Using mini_portile version 2.1.0
checking for iconv.h... yes
checking for gzdopen() in -lz... yes
checking for iconv... yes
Any ideas as to what might be going on here?
try
gem install sablon -- --use-system-libraries=true
if it doesn't work may i ask how you installed xcode command line tools?

Gem::Ext::BuildError: ERROR: Failed to build gem native extension(ffi gem) - windows

When I run bundle install, it fails when it try to install ffi gem with native extension. I get this error
Installing ffi 1.8.1 with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
C:/Ruby21-x64/bin/ruby.exe extconf.rb
checking for ffi.h... no
checking for ffi.h in /usr/local/include,/usr/include/ffi... no
checking for rb_thread_blocking_region()... yes
checking for rb_thread_call_with_gvl()... yes
checking for rb_thread_call_without_gvl()... yes
checking for ffi_prep_cif_var()... no
creating extconf.h
creating Makefile
make "DESTDIR="
generating ffi_c-x64-mingw32.def
Configuring libffi
configure: WARNING: if you wanted to set the --build type, don't use --host.
If a cross compiler is detected then cross compile mode will be used
configure: WARNING: cache variable lt_cv_path_LD contains a newline
configure: WARNING: cache variable lt_cv_path_LD contains a newline
make -C "/c/Ruby21-x64/lib/ruby/gems/2.1.0/gems/ffi-1.8.1/ext/ffi_c/libffi-x64-mingw32"
make[1]: Entering directory `/c/Ruby21-x64/lib/ruby/gems/2.1.0/gems/ffi-1.8.1/ext/ffi_c/libffi-x64-mingw32'
Makefile:318: *** missing separator. Stop.
make[1]: Leaving directory `/c/Ruby21-x64/lib/ruby/gems/2.1.0/gems/ffi-1.8.1/ext/ffi_c/libffi-x64-mingw32'
make: *** ["/c/Ruby21-x64/lib/ruby/gems/2.1.0/gems/ffi-1.8.1/ext/ffi_c/libffi-x64-mingw32"/.libs/libffi_convenience.a] Error 2
Gem files will remain installed in C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/ffi-1.8.1 for inspection.
Results logged to C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/ffi-1.8.1/ext/ffi_c/gem_make.out
An error occurred while installing ffi (1.8.1), and Bundler cannot continue.
Make sure that `gem install ffi -v '1.8.1'` succeeds before bundling.
I am on windows 7 with ruby 2.1.7 and rails 3.2. I have found different solution like updating system gems and downgrading ffi version but none of them is working for me. How can I solve this problem?

Nokogiri native extension failing to build (Not libxml2 or libxslt missing issue)

As the title says, it doesn't seem to be failing because libxml2 or libxslt is missing. I'm not really sure what to make of the error. (Get it? Because the issue is during make? hehe...)
Anywho, here's the output I'm getting. Any ideas would be appreciated:
Building native extensions. This could take a while...
ERROR: Error installing nokogiri:
ERROR: Failed to build gem native extension.
/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 iconv_open() in iconv.h... yes
checking for xmlParseDoc() in -lxml2... yes
checking for xsltParseStylesheetDoc() in -lxslt... yes
checking for exsltFuncRegister() in -lexslt... yes
checking for xmlHasFeature()... 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
make
compiling xml_element_content.c
compiling xml_relax_ng.c
compiling xml_cdata.c
compiling xml_sax_parser_context.c
compiling xml_node_set.c
compiling xml_text.c
compiling xml_sax_parser.c
compiling xml_attribute_decl.c
compiling nokogiri.c
nokogiri.c: In function ‘ruby_strdup’:
nokogiri.c:43:31: warning: conversion to ‘size_t’ from ‘long int’ may change the sign of the result [-Wsign-conversion]
compiling xml_entity_reference.c
compiling xml_node.c
compiling xml_xpath_context.c
xml_xpath_context.c: In function ‘xpath_generic_exception_handler’:
xml_xpath_context.c:184: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 /var/lib/gems/1.9.1/gems/nokogiri-1.5.0 for inspection.
Results logged to /var/lib/gems/1.9.1/gems/nokogiri-1.5.0/ext/nokogiri/gem_make.out
For context, I upgraded from Ubuntu 12.04 to 12.10 last night. I had previously built the Nokogiri native extension on this box, though I do not know if it was the same version or not.
I also checked that I have all packages specified in the second post on "error installing nokogiri 1.5.0 with rails 3.1.0 and ubuntu"
to no avail.
Took me some time to figure out how to append the cflags. Here is my command for nokogiri 1.4.7:
sudo gem install nokogiri -v '1.4.7' -- --with-cflags=\"-Wformat-nonliteral -Wno-format-security\"
If you're trying to install Nokogiri < 1.5.4, you'll have problems on hardened Debian systems like Ubuntu 12.
Details on the underlying issue are here: https://github.com/sparklemotion/nokogiri/issues/680
You should be able to upgrade to 1.5.4 or later and install without this problem.
Alternatively, you should be able to set the CFLAGS environment variable at gem-install time to include the string:
-Wno-error=format-security
or
-Wformat-nonliteral -Wno-format-security
Good luck!
Have you tried installing the following depencies for nokogiri??
# nokogiri requirements
sudo apt-get install libxslt-dev libxml2-dev
sudo gem install nokogiri
This may be happening due to this bug > https://leap.se/code/issues/7231
Run below before running the command:
sudo apt-get install zlib1g-dev

Installing ruby-debug-base19 on Windows in Ruby 1.9.3

I need to install ruby-debug-base19 in order to active debug on Netbeans IDE, when I execute:
$ gem install ruby-debug-base19
I got the following error. Extracted from log generate
C:/Ruby193/bin/ruby.exe extconf.rb
checking for rb_method_entry_t.body in method.h... no
checking for vm_core.h... no
C:/Ruby193/lib/ruby/gems/1.9.1/gems/ruby_core_source-0.1.5/lib/ruby_core_source.rb:39: Use RbConfig instead of obsolete and deprecated Config.
checking for rb_method_entry_t.body in method.h... no
checking for vm_core.h... yes
checking for iseq.h... yes
checking for insns.inc... yes
checking for insns_info.inc... yes
checking for eval_intern.h... yes
creating Makefile
make
generating ruby_debug-i386-mingw32.def
compiling breakpoint.c
compiling ruby_debug.c
ruby_debug.c:24:19: error: conflicting types for 'rb_iseq_compile_with_option'
C:/Ruby193/include/ruby-1.9.1/ruby-1.9.3-p125/vm_core.h:505:7: note: previous declaration of 'rb_iseq_compile_with_option' was here
ruby_debug.c: In function 'context_jump':
ruby_debug.c:2378:53: warning: comparison between signed and unsigned integer expressions
ruby_debug.c:2392:27: warning: comparison between signed and unsigned integer expressions
make: *** [ruby_debug.o] Error 1
Prerequisites:
Ruby installed successfully
$ ruby --version
>>ruby 1.9.3p125 (2012-02-16) [i386-mingw32]
DevKit installed successfully
$ gem install rdiscount --platform=ruby
>>Temporarily enhancing PATH to include DevKit...
>>Building native extensions. This could take a while...
>>Successfully installed rdiscount-1.6.8
>>1 gem installed
>>Installing ri documentation for rdiscount-1.6.8...
>>Installing RDoc documentation for rdiscount-1.6.8...
$ ruby -rubygems -e "require 'rdiscount'; puts RDiscount.new('**Hello RubyInstaller**').to_html"
>><p><strong>Hello RubyInstaller</strong></p>
I have read this article without success.
What I'm missing?
1) download linecache19-0.5.13.gem and ruby-debug-base19-0.11.26.gem from http://rubyforge.org/frs/?group_id=8883
2) gem install linecache19-0.5.13.gem
3) gem install ruby-debug-base19-0.11.26.gem -- --with-ruby-include=c:\Ruby193\include\ruby-1.9.1\ruby-1.9.3-p125

Resources