Couchbase Gem on Mac Yosemite - ruby

I have installed libcouchbase using homebrew and also building from source following these instructions http://docs.couchbase.com/couchbase-sdk-c-2.4/ but still get the error
Building native extensions. This could take a while...
ERROR: Error installing couchbase:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb
checking for lcb_iops_wire_bsd_impl2(NULL, 0) in -lcouchbase... no
**********************************************************************
* You must install libcouchbase >= 2.4.0
* See http://www.couchbase.com/communities/c/ for more details
**********************************************************************
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
I'm using ruby 2.0

Judging by the error message, it would appear you need the latest version of libcouchbase. Ensure you do a brew update first so that brew is aware of the latest version.
mnunberg#mbp15 ~ $ cbc version
cbc:
Runtime: Version=2.4.6, Changeset=803c3c79cd72455aa62ab39eaf7a597e5d6de7e5
Headers: Version=2.4.6, Changeset=803c3c79cd72455aa62ab39eaf7a597e5d6de7e5
IO: Default=libevent, Current=libevent
SSL: .. SUPPORTED

Related

ERROR: Error installing psych: ERROR: Failed to build gem native extension

I am trying to update psych to 5.0.0, but I get the following error message:
Updating psych
Temporarily enhancing PATH for MSYS/MINGW...
Building native extensions. This could take a while...
ERROR: Error installing psych:
ERROR: Failed to build gem native extension.
current directory: C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/psych-5.0.0/ext/psych
C:/Ruby31-x64/bin/ruby.exe -I C:/Ruby31-x64/lib/ruby/site_ruby/3.1.0 extconf.rb
checking for yaml.h... no
yaml.h not found
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
Provided configuration options:
.
.
.
To see why this extension failed to compile, please check the mkmf.log which can be found here:
C:/Ruby31-x64/lib/ruby/gems/3.1.0/extensions/x64-mingw-ucrt/3.1.0/psych-5.0.0/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/psych-5.0.0 for inspection.
Results logged to C:/Ruby31-x64/lib/ruby/gems/3.1.0/extensions/x64-mingw-ucrt/3.1.0/psych-5.0.0/gem_make.out
Tried gem update, gem pristine --all, same error.
Any tips how to fix this in Windows?
Thank you!
Not sure how it was fixed but I ran gem update and psych was updated to 5.0.2 without an error.
I had a similar problem on Mac running OSX 13.2. Bundle install failed because it couldn't find yaml.h.
Since I was on Mac and running Homebrew, I did a
brew install libyaml
and then re-ran bundle install. It worked correctly.
You need to install libyaml via pacman -S mingw-w64-ucrt-x86_64-libyamlin the command prompt with ruby

How to configure Fedora 29 to use ruby 'number-theory' gem?

So basically RubyNumberTheory require the NArray gem, and it seems it requires some native compilation tools and probably some additional configuration. So on a Fedora 29, here is what was tried
$ gem install narray
Building native extensions. This could take a while...
ERROR: Error installing narray:
ERROR: Failed to build gem native extension.
[…]
checking for stdint.h... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
I did installed a few packages, through dnf like gcc ruby-devel rubygems and group install "C Development Tools and Libraries"and even some more unexpected arm-none-eabi-newlib. Actually, the header seems well installed on the system
$ whereis stdint.h
stdint: /usr/include/stdint.h
Even with environment variable set as following:
export LIBRARY_PATH=/usr/include
export LD_LIBRARY_PATH=/lib:/usr/lib:/usr/local/lib:/usr/include
The gem still won't install, telling stdint.h wasn't found. What else could be attempted?
Looking in the mkmf.log file, it appeared the system was lacking redhat-hardened-cc1, so a simple sudo dnf install redhat-rpm-config fixed that.

What does XCode installing do when solving 'gem install sqilte3' error(Failed to build gem native extension.)?

I was trying to install gem sqlite3 but failed with error below.
ERROR: Error installing sqlite3:
ERROR: Failed to build gem native extension.
/usr/local/opt/ruby/bin/ruby -r ./siteconf20151016-8328-1i1buur.rb extconf.rb --with-sqlite3-dir /usr/bin
extconf.rb failed
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details.
.....
I just searched through and solved it via installing XCode before installing sqlite3, can anyone tell me the reason? What does XCode actually do?
I am a newbie on those gem of Ruby.
Installing XCode (or more precisely the XCode command line tools) will also install the toolchain needed to compile the native extensions (written in C) needed by the sqlite3 gem.

Install gems on Windows with RailInstaller: "You must have zlib installed"

I'm on Windows, with Ruby 2.0 installed using RailsInstaller.
When I tried to install id3lib-ruby using gem install id3lib-ruby, I get the following:
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing id3lib-ruby:
ERROR: Failed to build gem native extension.
C:/RailsInstaller/Ruby2.0.0/bin/ruby.exe extconf.rb
checking for main() in -lstdc++... yes
checking for main() in -lz... no You must have zlib installed.
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers.
Check the mkmf.log file for more details.
You may need configuration options.
In mkmf.log, it includes the line:
c:/railsinstaller/devkit/mingw/bin/../lib/gcc/mingw32/4.5.2/../../../../mingw32/bin/ld.exe: cannot find -lz
collect2: ld returned 1 exit status
I have zlib1.dll in C:\RailsInstaller\Ruby2.0.0\bin, renaming the file to zlib.dll doesn't work. So, it looks like RubyInstaller already included the zlib library, but something's still causing the gem install to fail. Any ideas?
Couldn't work it out. "Fixed" by installing RailsInstaller 2.2.2 (Ruby 1.9.3) and taglib-ruby instead.

Can't Install Eventmachine On Synology DiskStation With OpenSSL

I'm trying to install the EventMachine ruby gem on my Synology DiskStation DS211 Linux-based NAS, but the installation fails while trying to create the Makefile for the native extension, saying:
> gem install eventmachine --pre
Building native extensions. This could take a while...
ERROR: Error installing eventmachine:
ERROR: Failed to build gem native extension.
/opt/bin/ruby extconf.rb
checking for main() in -lssl... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
The contents of mkmf.log:
package configuration for openssl is not found
Ruby and OpenSSL were both installed successfully on the machine using Optware ipkg to the default /opt directory.
I suspect that EventMachine fails due to OpenSSL being installed in an unexpected directory, but it is unclear which combination of configuration options and values are necessary to specify the correct location.
Some environment details:
> ruby -v
ruby 1.9.1p243 (2009-07-16 revision 24175) [arm-linux-eabi]
> openssl version
OpenSSL 0.9.8p 16 Nov 2010
> which openssl
/opt/bin/openssl
Has anyone else had any luck installing EventMachine in this environment?
You need install openssl-dev package:
ipkg install openssl-dev
openssl-dev contains package configuration(openssl.pc) and header files.

Resources