I am having trouble installing the newest libxml-ruby gem for ruby 2.3.3. Here is the error I am getting:
ERROR: Error installing libxml-ruby:
ERROR: Failed to build gem native extension.
current directory: C:/Ruby-2.3.3/lib/ruby/gems/2.3.0/gems/libxml-ruby-2.9.0/ext/libxml
C:/Ruby-2.3.3/bin/ruby.exe -r ./siteconf20170117-6916-4mgpq6.rb extconf.rb
checking for libxml/xmlversion.h in /opt/include/libxml2,/opt/local/include/libxml2,/usr/local/include/libxml2,/usr/include/libxml2... yes
checking for xmlParseDoc() in -lxml2... no
*** 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:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=C:/Ruby-2.3.3/bin/$(RUBY_BASE_NAME)
--with-xml2-config
--without-xml2-config
--with-xml2-dir
--without-xml2-dir
--with-xml2-include
--without-xml2-include=${xml2-dir}/include
--with-xml2-lib
--without-xml2-lib=${xml2-dir}/lib
--with-xml2lib
--without-xml2lib
extconf failure: need libxml2.
Install the library or try one of the following options to extconf.rb:
--with-xml2-config=/path/to/xml2-config
--with-xml2-dir=/path/to/libxml2
--with-xml2-lib=/path/to/libxml2/lib
--with-xml2-include=/path/to/libxml2/include
To see why this extension failed to compile, please check the mkmf.log which can be found here:
I have found similar issues when looking for a solution, but no answer to the problem. Has anyone been able to fix this?
Related
I'm trying to install capybara, on my ruby 2.7.3 system, and it's failing.
I appear to not be able to look at the output and see the magic words Command 'qmake ' not available
my output:
gem install capybara-webkit
Building native extensions. This could take a while...
ERROR: Error installing capybara-webkit:
ERROR: Failed to build gem native extension.
current directory: /var/home/user/.rvm/gems/ruby-2.7.3/gems/capybara-webkit-1.15.1
/var/home/user/.rvm/rubies/ruby-2.7.3/bin/ruby -I /var/home/user/.rvm/rubies/ruby-2.7.3/lib/ruby/2.7.0 -r ./siteconf20210604-1512733-c8fw23.rb extconf.rb
*** 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:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/var/home/user/.rvm/rubies/ruby-2.7.3/bin/$(RUBY_BASE_NAME)
--with-gl-dir
--without-gl-dir
--with-gl-include
--without-gl-include=${gl-dir}/include
--with-gl-lib
--without-gl-lib=${gl-dir}/lib
--with-zlib-dir
--without-zlib-dir
--with-zlib-include
--without-zlib-include=${zlib-dir}/include
--with-zlib-lib
--without-zlib-lib=${zlib-dir}/lib
Command 'qmake ' not available
extconf failed, exit code 1
Gem files will remain installed in /var/home/user/.rvm/gems/ruby-2.7.3/gems/capybara-webkit-1.15.1 for inspection.
Results logged to /var/home/user/.rvm/gems/ruby-2.7.3/extensions/x86_64-linux/2.7.0/capybara-webkit-1.15.1/gem_make.out
I'm trying to install the pg gem in my project but I get the following error when I run gem install pg, or if I run bundle install:
ERROR: Error installing pg:
ERROR: Failed to build gem native extension.
current directory: /home/ec2-user/.rvm/gems/ruby-2.6.3/gems/pg-1.1.4/ext
/home/ec2-user/.rvm/rubies/ruby-2.6.3/bin/ruby -I /home/ec2-
user/.rvm/rubies/ruby-2.6.3/lib/ruby/site_ruby/2.6.0 -r
./siteconf20191103-5491-ro2ye0.rb extconf.rb
checking for pg_config... no
No pg_config... trying anyway. If building fails, please try again with
--with-pg-config=/path/to/pg_config
checking for libpq-fe.h... no
Can't find the 'libpq-fe.h header
*** 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:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/home/ec2-user/.rvm/rubies/ruby-2.6.3/bin/$(RUBY_BASE_NAME)
--with-pg
--without-pg
--enable-windows-cross
--disable-windows-cross
--with-pg-config
--without-pg-config
--with-pg_config
--without-pg_config
--with-pg-dir
--without-pg-dir
--with-pg-include
--without-pg-include=${pg-dir}/include
--with-pg-lib
--without-pg-lib=${pg-dir}/lib
To see why this extension failed to compile, please check the mkmf.log
which can be found here:
/home/ec2-user/.rvm/gems/ruby-2.6.3/extensions/x86_64-linux/2.6.0/pg-
1.1.4/mkmf.log
extconf failed, exit code 1
As you can see, I'm using Ruby version 2.6.3 and I'm on a Windows.
I'm trying to install the pg gem so that I can connect to the database.
I'm very new to all of this, so any help would be greatly appreciated
You are missing pg_config, which means most likely the pg development package has not been installed.
apt install libpq-dev
Go to https://rubygems.org/gems/pg ruby gems site and copy the latest gem into your gemfile. For me that was something like gem 'pg', '~> 1.3.0.rc1'.
While installing iconv on windows I get the following errors
following the advice of a users post here I tried the following after installing libconv http://gnuwin32.sourceforge.net/packages/libiconv.htm
gem install iconv -v '1.0.4' -- --with-iconv-dir=C:\Program Files (x86)\GnuWin32
I had no success, below are the output errors.
error in cmd
C:\Users\ALilland\Documents\macros\experiments\core_scripts\app>gem install iconv -v '1.0.4' -- --with-iconv-dir=C:\Program Files (x86)\GnuWin32
Temporarily enhancing PATH to include DevKit...
Building native extensions with: '--with-iconv-dir=C:\Program Files (x86)\GnuWin32'
This could take a while...
ERROR: Error installing iconv:
ERROR: Failed to build gem native extension.
C:/Ruby22/bin/ruby.exe -r ./siteconf20160919-12804-5eyr6.rb extconf.rb --with-iconv-dir=C:\Program Files (x86)\GnuWin32
checking for rb_enc_get() in ruby/encoding.h... yes
checking for rb_sys_fail_str() in ruby.h... yes
checking for iconv() in iconv.h... no
checking for iconv() in -liconv... no
*** 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:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=C:/Ruby22/bin/$(RUBY_BASE_NAME)
--with-iconv-dir
--with-iconv-include
--without-iconv-include=${iconv-dir}/include
--with-iconv-lib
--without-iconv-lib=${iconv-dir}/lib
--enable-config-charset
--disable-config-charset
--with-config-charset
--without-config-charset
--with-iconvlib
--without-iconvlib
extconf failed, exit code 1
Gem files will remain installed in C:/Ruby22/lib/ruby/gems/2.2.0/gems/iconv-1.0.4 for inspection.
Results logged to C:/Ruby22/lib/ruby/gems/2.2.0/extensions/x86-mingw32/2.2.0/iconv-1.0.4/gem_make.out
C:\Users\ALilland\Documents\macros\experiments\core_scripts\app>
gem_make.out
C:/Ruby22/bin/ruby.exe -r ./siteconf20160919-12804-5eyr6.rb extconf.rb --with-iconv-dir=C:\Program Files (x86)\GnuWin32
checking for rb_enc_get() in ruby/encoding.h... yes
checking for rb_sys_fail_str() in ruby.h... yes
checking for iconv() in iconv.h... no
checking for iconv() in -liconv... no
*** 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:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=C:/Ruby22/bin/$(RUBY_BASE_NAME)
--with-iconv-dir
--with-iconv-include
--without-iconv-include=${iconv-dir}/include
--with-iconv-lib
--without-iconv-lib=${iconv-dir}/lib
--enable-config-charset
--disable-config-charset
--with-config-charset
--without-config-charset
--with-iconvlib
--without-iconvlib
extconf failed, exit code 1
I solved this issue by,
Error while installing iconv on windows by ruby2.0.0
Tricky part was copying files from /include, /bin and /lib of /GnuWin32 quickly into /Ruby2.2.0/lib/ruby/gems/2.2.0/gems/iconv-1.0.4/ext/iconv when gem install goes to Building native extensions. This could take a while...
Hope this will help someone.
On my Ubuntu 14.04 I installed Ruby 2.2.0 using RVM.
I have installed the "taglib" using following command sudo apt-get install libtag1-dev.
However when I try to install a gem I get the following error:
> gem install stream2tracks
Building native extensions. This could take a while...
ERROR: Error installing stream2tracks:
ERROR: Failed to build gem native extension.
/home/dash/.rvm/rubies/ruby-2.2.0-dev/bin/ruby -r ./siteconf20150207-2313-h67sa7.rb extconf.rb
checking for ruby.h... yes
checking for taglib/tag_c.h... no
*** 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:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/home/dash/.rvm/rubies/ruby-2.2.0-dev/bin/$(RUBY_BASE_NAME)
extconf failed, exit code 1
Gem files will remain installed in /home/dash/.rvm/gems/ruby-2.2.0-dev/gems/taglib2-0.1.5 for inspection.
You need to install libtagc0-dev to get TagLib's C header (the one the gem is checking for).
This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Unable to install pg gem on ubuntu - Can’t find the 'libpq-fe.h header
Here is the error while trying to do bundle install
Building native extensions. This could take a while...
ERROR: Error installing pg:
ERROR: Failed to build gem native extension.
/usr/bin/ruby1.8 extconf.rb
checking for pg_config... no
No pg_config... trying anyway. If building fails, please try again with
--with-pg-config=/path/to/pg_config
checking for libpq-fe.h... no
Can't find the 'libpq-fe.h header
*** 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:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/bin/ruby1.8
--with-pg
--without-pg
--with-pg-dir
--without-pg-dir
--with-pg-include
--without-pg-include=${pg-dir}/include
--with-pg-lib
--without-pg-lib=${pg-dir}/lib
--with-pg-config
--without-pg-config
--with-pg_config
--without-pg_config
Gem files will remain installed in /var/lib/gems/1.8/gems/pg-0.14.1 for inspection.
Results logged to /var/lib/gems/1.8/gems/pg-0.14.1/ext/gem_make.out
i'm using ubuntu 12.04.Can any one point what may be wrong
Looks like you need to install the dev libraries for postgres:
sudo apt-get install libpq-dev