Can't Install Curb - Having problems with native extensions. - ruby

I'm trying to install the curb gem on my Debian machine but I'm having a hard time building the gem with native extensions. I'm using RVM.
Just a list of things I'm using:
debian
bundler
rvm
ruby-1.9.2-p180
curb
I'm told I have to install the following packages and I've done so:
sudo apt-get install libcurl3 libcurl3-gnutls libcurl4-openssl-dev
When I go ahead and do as such:
gem install curb
Building native extensions. This could take a while...
ERROR: Error installing curb:
ERROR: Failed to build gem native extension.
/usr/local/rvm/rubies/ruby-1.9.2-p180/bin/ruby extconf.rb
checking for curl-config... yes
checking for curlinfo_redirect_time... * 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/local/rvm/rubies/ruby-1.9.2-p180/bin/ruby
--with-curl-dir
--with-curl-include
--without-curl-include=${curl-dir}/include
--with-curl-lib
--without-curl-lib=${curl-dir}/lib
/usr/local/rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:368:in try_do': The complier failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /usr/local/rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:446:intry_compile'
from extconf.rb:51:in block in have_constant'
from /usr/local/rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:693:inblock in checking_for'
from /usr/local/rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:280:in block (2 levels) in postpone'
from /usr/local/rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:254:inopen'
from /usr/local/rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:280:in block in postpone'
from /usr/local/rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:254:inopen'
from /usr/local/rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:276:in postpone'
from /usr/local/rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:692:inchecking_for'
from extconf.rb:43:in have_constant'
from extconf.rb:60:in'
I don't any way around this, any ideas?
Thanks buds.

On a Debian Squeeze, I've managed to install curb with libcurl4-openssl-dev installed before.
It may also work with libcurl4-gnutls-dev, but I've no tested.

You probably need to install curl-devel package.
yum install curl-devel

openssl used to work for me, but now libcurl4-gnutls-dev is all that works for me...

Related

pg gem installation is giving error in Redhat

I am executing gem install pg to install the pg and execute chef scripts afterwards in Redhat AWS machine. I am getting following error:
gem install pg Building native extensions. This could take a while...
ERROR: Error installing pg:
ERROR: Failed to build gem native extension.
current directory: /opt/chef/embedded/lib/ruby/gems/2.5.0/gems/pg-1.1.4/ext/opt/chef/embedded/bin/ruby -r ./siteconf20190924-20230-k0ngu5.rb extconf.rb
checking for pg_config... yes
Using config values from /bin/pg_config
checking for libpq-fe.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.
Provided configuration options:
--with-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=/opt/chef/embedded/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=${pg-dir}/include
--with-pg-lib
--without-pg-lib=${pg-dir}/lib
/opt/chef/embedded/lib/ruby/2.5.0/mkmf.rb:467:in `try_do': The compiler failed to generate an executable file. (RuntimeError) You have to install development tools first.
from /opt/chef/embedded/lib/ruby/2.5.0/mkmf.rb:601:in `try_cpp'
from /opt/chef/embedded/lib/ruby/2.5.0/mkmf.rb:1162:in `block in find_header'
from /opt/chef/embedded/lib/ruby/2.5.0/mkmf.rb:959:in `block in checking_for'
from /opt/chef/embedded/lib/ruby/2.5.0/mkmf.rb:350:in `block (2 levels) in postpone'
from /opt/chef/embedded/lib/ruby/2.5.0/mkmf.rb:320:in `open'
from /opt/chef/embedded/lib/ruby/2.5.0/mkmf.rb:350:in `block in postpone'
from /opt/chef/embedded/lib/ruby/2.5.0/mkmf.rb:320:in `open'
from /opt/chef/embedded/lib/ruby/2.5.0/mkmf.rb:346:in `postpone'
from /opt/chef/embedded/lib/ruby/2.5.0/mkmf.rb:958:in `checking_for'
from /opt/chef/embedded/lib/ruby/2.5.0/mkmf.rb:1161:in `find_header'
from extconf.rb:54:in `<main>'
To see why this extension failed to compile, please check the mkmf.log
which can be found here:
/opt/chef/embedded/lib/ruby/gems/2.5.0/extensions/x86_64-linux/2.5.0/pg-1.1.4/mkmf.log
extconf failed, exit code 1
I am trying this with root user. I have installed postgresql-devel too using yum and tried to provide --with-pg-include too where libpq-fe.h resides (suggested in some other posts) but couldn't resolve the issue.
You first need to install build tools (i.e. a C compiler and related tools) as well as development headers for your postgres server to be able to compile the gem.
For RedHat, you should be able to get all required tools with
yum install autoconf bison flex gcc gcc-c++ gettext kernel-devel make m4 ncurses-devel patch
yum install postgresql-devel
With Chef 14, you can use the built-in build_essential resource to install the required compiler packages. On older versions, you can use the build-essential cookbook.

Can't install charlock holmes gem, libicu-devel installed

I am trying to install charlock holmes, nevertheless, I keep getting an error:
[root#hugovm gitlab]# gem install charlock_holmes --version '0.6.9.4'
Building native extensions. This could take a while...
ERROR: Error installing charlock_holmes:
ERROR: Failed to build gem native extension.
/usr/bin/ruby extconf.rb
checking for main() in -licui18n... yes
checking for main() in -licui18n... yes
checking for unicode/ucnv.h... yes
-- tar zxvf file-5.08.tar.gz
-- ./configure --prefix=/usr/local/share/gems/gems/charlock_holmes-0.6.9.4/ext/charlock_holmes/dst/ --disable-shared --enable-static --with-pic
-- patch -p0 < ../file-soft-check.patch
*** 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}/lib64
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/bin/ruby
--with-icu-dir
--without-icu-dir
--with-icu-include
--without-icu-include=${icu-dir}/include
--with-icu-lib
--without-icu-lib=${icu-dir}/
--with-icui18nlib
--without-icui18nlib
--with-icui18nlib
--without-icui18nlib
extconf.rb:7:in `sys': patch -p0 < ../file-soft-check.patch failed, please report issue on http://github.com/brianmario/charlock_holmes (RuntimeError)
from extconf.rb:61:in `block (2 levels) in <main>'
from extconf.rb:59:in `chdir'
from extconf.rb:59:in `block in <main>'
from extconf.rb:55:in `chdir'
from extconf.rb:55:in `<main>'
Gem files will remain installed in /usr/local/share/gems/gems/charlock_holmes-0.6.9.4 for inspection.
Results logged to /usr/local/share/gems/gems/charlock_holmes-0.6.9.4/ext/charlock_holmes/gem_make.out
I already installed libicu-devel.
Thanks
I had the exact same issue today. Tried to install gitlab on a clean fedora machine.
For me, a line in /usr/local/share/gems/gems/charlock_holmes-0.6.9.4/ext/charlock_holmes/gem_make.out pointed to mkmf.log, which is in the same directory as above log file.
There it said "patch: command not found"
sudo yum install patch
In you output I can read:
extconf.rb:7:in `sys': patch -p0 < ../file-soft-check.patch failed, please report issue on http://github.com/brianmario/charlock_holmes (RuntimeError)
So it all points to a bug. I suppose it is a good idea follow the output and created an issue there, explaining what you are trying to do and giving details of your environment.
ruby-devel is missing
yum install ruby-devel
and you'll be set :)

Cannot gem install ruby-augeas on Ubuntu

I am trying to install augeas on Ubuntu.
sudo gem install ruby-augeas
This gives me the error:
Building native extensions. This could take a while...
ERROR: Error installing ruby-augeas:
ERROR: Failed to build gem native extension.
/usr/bin/ruby1.9.1 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=/usr/bin/ruby1.9.1
--with-augeas-config
--without-augeas-config
--with-pkg-config
--without-pkg-config
extconf.rb:27:in `<main>': augeas-devel not installed (RuntimeError)
I had
sudo apt-get install ruby1.8-dev ruby1.9.1-dev augeas-tools libaugeas-dev
Btw, where is the mkmf.log file?
How should I install augeas? I need to install it using gem as this will be used for Puppet's version of Ruby.
you need at least build-essential package to compile native extensions. Also make sure you have all the ruby base libraries precompiled (or in the rvm).
Try to install rvm itself, it will give you a list of required packages just after installation.

How can install sqlite-ruby on linux when sqlite3 is not in /usr/local?

I am trying to install sqlite3 and sqlite-ruby (ruby 1.8.6) on a linux box where I do not have root.
I downloaded the sqlite3 source, binaries, and shared library and placed them all in a directory called sqlite3
I then try to install sqlite-ruby using
gem install sqlite-ruby --with-sqlite-dir=the_path_sqlite/sqlite3
but I keep getting the error...
checking for main() in -lsqlite... no
checking for sqlite.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=/data/scratch/bettbra/common/packages/ruby-1.8.6/bin/ruby
--with-sqlite-dir
--with-sqlite-include
--without-sqlite-include=${sqlite-dir}/include
--with-sqlite-lib
--without-sqlite-lib=${sqlite-dir}/lib
--with-sqlitelib
--without-sqlitelib
You specify where the development files (headers & lib) are using the following syntax:
gem install sqlite3 -- --with-sqlite3-include=$HOME/include --with-sqlite3-lib=$HOME/lib
Notice the -- that mark the end of gem options. After them, the options are passed to the extension compiling process.
However, I second Reuben's advice; you should really consider using RVM. It is a blessing for this kind of situations AND to smooth your migration to Ruby 1.9.
i'm using ubuntu (debain type linux). i managed to resolve it the following way:
sudo apt-get install sqlite3 libsqlite3-dev
sudo gem install sqlite3-ruby
Can you install RVM (Ruby Version Manager) ?
https://rvm.io/rvm/install/
With RVM you install gems etc. as a user without sudo/root privileges.

Installing Hpricot on Ruby 1.9.1 on Windows

I am trying to install hpricot using the command:
>gem install hpricot -v 0.8.2
Building native extensions. This could take a while...
ERROR: Error installing hpricot:
ERROR: Failed to build gem native extension.
C:/Ruby19/bin/ruby.exe extconf.rb
checking for stdio.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.
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:/Ruby19/bin/ruby
C:/Ruby19/lib/ruby/1.9.1/mkmf.rb:362:in try_do': The complier failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from C:/Ruby19/lib/ruby/1.9.1/mkmf.rb:431:intry_cpp'
from C:/Ruby19/lib/ruby/1.9.1/mkmf.rb:809:in block in have_header'
from C:/Ruby19/lib/ruby/1.9.1/mkmf.rb:668:inblock in checking_for'
from C:/Ruby19/lib/ruby/1.9.1/mkmf.rb:274:in block (2 levels) in postpone'
from C:/Ruby19/lib/ruby/1.9.1/mkmf.rb:248:inopen'
from C:/Ruby19/lib/ruby/1.9.1/mkmf.rb:274:in block in postpone'
from C:/Ruby19/lib/ruby/1.9.1/mkmf.rb:248:inopen'
from C:/Ruby19/lib/ruby/1.9.1/mkmf.rb:270:in postpone'
from C:/Ruby19/lib/ruby/1.9.1/mkmf.rb:667:inchecking_for'
from C:/Ruby19/lib/ruby/1.9.1/mkmf.rb:808:in have_header'
from extconf.rb:2:in'
Gem files will remain installed in C:/Ruby19/lib/ruby/gems/1.9.1/gems/hpricot-0.8.2 for inspection.
Results logged to C:/Ruby19/lib/ruby/gems/1.9.1/gems/hpricot-0.8.2/ext/fast_xs/gem_make.out
it mentions I need to install "development tools" but I have no idea what that refers to. Any suggestions?
Try:
gem install hpricot --platform=mswin32
Install the devkit at rubyinstaller.org/downloads
Execute below command and it works:
gem install hpricot --platform=mswin32
An additional note that others may find useful, from my recent attempt to install on Windows using the Ruby devkit:
To install the devkit, you extract the bin and devkit directories to your Ruby directory which will place a few files in your Ruby bin and a devkit directory in your Ruby directory. Then, per the instructions, you set the proper location for mingw in the fstab file.
In my case, some gems, namely Hpricot and Ruby-Debug19, would not install on my system even with the devkit installed properly because of an error creating the makefile. I ended up installing the latest version of mingw separately from SourceForge, then changed the fstab file within the "ruby19/devkit/msys/1.0.11/etc" directory to point to the directory where I installed mingw. Both gems then installed correctly.
Execute the following command:
gem install hpricot

Resources