gem install memcached with ruby failed - ruby-on-rails

that is the error message:
/home/alan/.rvm/rubies/ruby-2.0.0-p481/bin/ruby extconf.rb
checking for sasl/sasl.h... no
Please install SASL to continue. The package is called libsasl2-dev on Ubuntu and cyrus-sasl on Gentoo.
*** 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/alan/.rvm/rubies/ruby-2.0.0-p481/bin/ruby
extconf failed, exit code
Thanks for helping me if u have spare time.

It clearly states that some library is missing
Please install SASL to continue. The package is called libsasl2-dev on Ubuntu and cyrus-sasl on Gentoo.
*** extconf.rb failed ***
For Ubuntu you have to install those
sudo apt-get install libsasl2
sudo apt-get install libsasl2-dev
For Gentoo
install
cyrus-sasl

If you read the error logs, it says:
Please install SASL to continue. The package is called libsasl2-dev on
Ubuntu and cyrus-sasl on Gentoo.
Try installing following packages before proceeding (for Ubuntu):
sudo apt-get install libsasl2
sudo apt-get install libsasl2-dev

Related

Can't install RMagick 4.2.3

I'm running Debian WSL 2 and I cannot install any version of RMagick.
I installed imagemagick#6 via homebrew and after installation I saw following:
imagemagick#6 is keg-only, which means it was not symlinked into /home/linuxbrew/.linuxbrew,
because this is an alternate version of another formula.
If you need to have imagemagick#6 first in your PATH, run:
echo 'export PATH="/home/linuxbrew/.linuxbrew/opt/imagemagick#6/bin:$PATH"' >> ~/.zshrc
For compilers to find imagemagick#6 you may need to set:
export LDFLAGS="-L/home/linuxbrew/.linuxbrew/opt/imagemagick#6/lib"
export CPPFLAGS="-I/home/linuxbrew/.linuxbrew/opt/imagemagick#6/include"
For pkg-config to find imagemagick#6 you may need to set:
export PKG_CONFIG_PATH="/home/linuxbrew/.linuxbrew/opt/imagemagick#6/lib/pkgconfig"
I followed all the instructions above
then I tried to install RMagick via gem install rmagick -v '4.1.2' --source 'https://rubygems.org/'
and got output:
Building native extensions. This could take a while...
ERROR: Error installing rmagick:
ERROR: Failed to build gem native extension.
current directory: /home/ketch/.asdf/installs/ruby/2.7.1/lib/ruby/gems/2.7.0/gems/rmagick-4.1.2/ext/RMagick
/home/ketch/.asdf/installs/ruby/2.7.1/bin/ruby -I /home/ketch/.asdf/installs/ruby/2.7.1/lib/ruby/2.7.0 -r ./siteconf20211106-21975-1odkmjc.rb extconf.rb
checking for brew... yes
checking for Ruby version >= 2.3.0... yes
checking for pkg-config... yes
ERROR: Can't install RMagick 4.1.2. Can't find ImageMagick with pkg-config
*** 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/ketch/.asdf/installs/ruby/2.7.1/bin/$(RUBY_BASE_NAME)
To see why this extension failed to compile, please check the mkmf.log which can be found here:
/home/ketch/.asdf/installs/ruby/2.7.1/lib/ruby/gems/2.7.0/extensions/x86_64-linux/2.7.0/rmagick-4.1.2/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in /home/ketch/.asdf/installs/ruby/2.7.1/lib/ruby/gems/2.7.0/gems/rmagick-4.1.2 for inspection.
Results logged to /home/ketch/.asdf/installs/ruby/2.7.1/lib/ruby/gems/2.7.0/extensions/x86_64-linux/2.7.0/rmagick-4.1.2/gem_make.out
I tried to install rmagick on my WSL debian, WSL ubuntu, and on Manjaro through virtual machine, everytime the same error

Sudo gem install rails

ERROR: Error installing rails:
ERROR: Failed to build gem native extension.
current directory: /Library/Ruby/Gems/2.3.0/gems/nokogiri-1.10.1/ext/nokogiri
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby -I /Library/Ruby/Site/2.3.0 -r ./siteconf20190304-9093-ehjkih.rb extconf.rb
checking if the C compiler accepts -I /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/libxml2... * 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=/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/$(RUBY_BASE_NAME)
--help
--clean
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/mkmf.rb:456:in try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/mkmf.rb:571:inblock in try_compile'
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/mkmf.rb:522:in with_werror'
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/mkmf.rb:571:intry_compile'
from extconf.rb:138:in nokogiri_try_compile'
from extconf.rb:162:inblock in add_cflags'
from /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/mkmf.rb:629:in with_cflags'
from extconf.rb:161:inadd_cflags'
from extconf.rb:416:in `'
To see why this extension failed to compile, please check the mkmf.log which can be found here:
/Library/Ruby/Gems/2.3.0/extensions/universal-darwin-16/2.3.0/nokogiri-1.10.1/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in /Library/Ruby/Gems/2.3.0/gems/nokogiri-1.10.1 for inspection.
Results logged to /Library/Ruby/Gems/2.3.0/extensions/universal-darwin-16/2.3.0/nokogiri-1.10.1/gem_make.out
first, run this command
sudo apt-get -f install
then, run this command
sudo apt-get install ruby-dev zlib1g-dev liblzma-dev
this will install dependencies. gem native extension successfully build.

I'm trying to install OpenGraph gem in ruby

I've searched entire web looking for a way to get over this error. But it won't budge. I installed all the libraries and dependencies according to my knowledge even uninstalled ruby and nokogiri and reinstalled again. But this error remains here.
Gem files will remain installed in /home/$User/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/nokogiri-1.4.7 for inspection.
Results logged to /home/$User/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/extensions/x86_64-linux/2.4.0-static/nokogiri-1.4.7/gem_make.out
This is from the gem_make.out log file from this location -> /.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/extensions/x86_64-linux/2.4.0-static/nokogiri-1.4.7/gem_make.out
ERROR: Error installing opengraph:
ERROR: Failed to build gem native extension.
current directory: /home/$User/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/nokogiri-1.4.7/ext/nokogiri
/home/$User/.rbenv/versions/2.4.2/bin/ruby -r ./siteconf20171125-15877-nibcps.rb extconf.rb --with-nokogiri-dir=/home/$User/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/
*** 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/$User/.rbenv/versions/2.4.2/bin/$(RUBY_BASE_NAME)
extconf.rb:10:in `<main>': uninitialized constant Config (NameError)
Did you mean? RbConfig
CONFIG
extconf failed, exit code 1
I'd be very thankful to you if you could tell me what's wrong with it. Is it a bug in OpenGraph.
P.S: I'm not using opengraph_parser because it has a fallback method. I need opengraph gem because I need to catch the exception.
It's not opengraph, but rather nokogiri.
Nokogiri is a dependency for opengraph.
https://rubygems.org/gems/opengraph/versions/0.0.4
So, it must be related on your machine not having the dependencies needed to support nokogiri (libxml2).
Install these dependencies on your machine (assuming your on Debian/Ubuntu):
sudo apt-get install build-essential patch ruby-dev zlib1g-dev liblzma-dev
Fedora/Red Hat/CentOS:
sudo yum install -y gcc ruby-devel zlib-devel
sudo yum install -y rubygem-nokogiri (alternative)
Then try installing nokogiri by gem install nokogiri
For other variants, or OS:
http://www.nokogiri.org/tutorials/installing_nokogiri.html
For Fedora 26:
Until further notice, install nokogiri version < 1.8

gem install ruby-odbc -v '0.99995' Not able install on ubuntu 11.10

I am not getting error while installing gem ruby-odbc -v'0.99995'.
Please help me to solve this error. I try lot of things but it didn't worked.
Building native extensions. This could take a while...
ERROR: Error installing ruby-odbc:
ERROR: Failed to build gem native extension.
/home/sheetal/.rvm/rubies/ruby-1.8.7-p371/bin/ruby extconf.rb
checking for version.h... yes
checking for sql.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/sheetal/.rvm/rubies/ruby-1.8.7-p371/bin/ruby
--with-odbc-dir
--without-odbc-dir
--with-odbc-include
--without-odbc-include=${odbc-dir}/include
--with-odbc-lib
--without-odbc-lib=${odbc-dir}/lib
ERROR: sql.h not found
I am using ruby 1.8.7 & rails2
Have you tried installing the unix odbc development files?
sudo apt-get install unixodbc-dev
If you're on OS X and having this issue try
brew install unixodbc
Then you should be able to
gem install ruby-odbc

Failed to build gem native extension while installing rmovie gem

I am trying to install rmovie gem on Ubuntu Desktop 12.04 LTS. ffmpeg is installed but I'm getting this error:
$ gem install rmovie
Building native extensions. This could take a while...
ERROR: Error installing rmovie:
ERROR: Failed to build gem native extension.
/home/ror_dev/.rvm/rubies/ruby-1.9.3-p362/bin/ruby extconf.rb
gcc -c -fpic -g qp_movie.c -o qp_movie.o
In file included from qp_movie.c:4:0:
qp_util.h:4:28: fatal error: ffmpeg/avcodec.h: No such file or directory
compilation terminated.
make: *** [qp_movie.o] Error 1
checking for avcodec_init() in -lavcodec... yes
checking for av_register_all() in -lavformat... yes
checking for quadrupel_init() in -lquadrupel... 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
--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/ror_dev/.rvm/rubies/ruby-1.9.3-p362/bin/ruby
--with-ffmpeg-dir
--without-ffmpeg-dir
--with-ffmpeg-include
--without-ffmpeg-include=${ffmpeg-dir}/include
--with-ffmpeg-lib
--without-ffmpeg-lib=${ffmpeg-dir}/lib
--with-quadrupel-dir
--without-quadrupel-dir
--with-quadrupel-include
--without-quadrupel-include=${quadrupel-dir}/include
--with-quadrupel-lib
--without-quadrupel-lib=${quadrupel-dir}/lib
--with-avcodeclib
--without-avcodeclib
--with-avformatlib
--without-avformatlib
--with-quadrupellib
--without-quadrupellib
extconf failed: need quadrupel library
First attempt was to relocate avcodec to where installer is searching for it. No success. Next - correcting paths in quadrupel files to point it to where avcodec is located. No success.
What is this quadrupel thing and how to force it to work?
Or maybe there is some replacement for rmovie?
Use github.com/streamio/streamio-ffmpeg, it is more actively developed. rmovie was developed in 2006 and it may not be compatible with the current version of ffmpeg
Do like this -
1) Keep the gem in a gemfile -
gem "rmovie", "~> 0.5.1"
2) Run bundle install
If still get errors try:
sudo apt-get install ffmpeg libavcodec-extra-52
If package not found try:
sudo apt-get install ffmpeg libavcodec-extra-53
you can also try to install the libmp3lame0 package:
sudo apt-get install libmp3lame0

Resources