Translate

Monday, February 23, 2015

ERROR: Error installing kingpong-ruby-mcrypt: ERROR: Failed to build gem native extension.

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    /Users/ahmadhassan/.rvm/rubies/ruby-1.9.3-p194/bin/ruby -r ./siteconf20150107-15315-1f92990.rb extconf.rb 
checking for mcrypt.h... no

########################################################################

Unable to find your mcrypt library.

Make sure you have libmcrypt installed (and libmcrypt-devel if you're
on a Linux distribution that does things that way).

If your libmcrypt is in a nonstandard location and has header files in
PREFIX/include and libraries in PREFIX/lib, try installing the gem like
this (note the extra "--"):

  gem install kingpong-ruby-mcrypt --source=http://gems.github.com \
      -- --with-mcrypt-dir=/path/to/mcrypt/prefix

You can also specify the include and library directories separately:

  gem install kingpong-ruby-mcrypt --source=http://gems.github.com \
      -- --with-mcrypt-include=/path/to/mcrypt/include \
         --with-mcrypt-lib=/path/to/mcrypt/lib

Specifically, if you're using MacPorts, this should work for you:

  sudo port install libmcrypt +universal
  sudo gem install kingpong-ruby-mcrypt --source=http://gems.github.com \
      -- --with-mcrypt-dir=/opt/local

########################################################################

*** 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=/Users/ahmadhassan/.rvm/rubies/ruby-1.9.3-p194/bin/ruby
        --with-mcrypt-dir
        --without-mcrypt-dir
        --with-mcrypt-include
        --without-mcrypt-include=${mcrypt-dir}/include
        --with-mcrypt-lib
        --without-mcrypt-lib=${mcrypt-dir}/lib

extconf failed, exit code 1

Gem files will remain installed in /Users/ahmadhassan/.rvm/gems/ruby-1.9.3-p194@call_center/gems/ruby-mcrypt-0.1.1 for inspection.
Results logged to /Users/ahmadhassan/.rvm/gems/ruby-1.9.3-p194@call_center/extensions/x86_64-darwin-14/1.9.1/ruby-mcrypt-0.1.1/gem_make.out
An error occurred while installing ruby-mcrypt (0.1.1), and Bundler cannot continue.
Make sure that `gem install ruby-mcrypt -v '0.1.1'` succeeds before bundling.




Solution :


brew install libmcrypt

Thursday, February 19, 2015

INSTALL RVM ( RUBY VERSION MANAGER ) IN UBUNTU 12.04 LINUX FOR RUBY

Let’s install Ruby Using RVM.
Removing old rvm and ruby from Machine
First of all lets clean-up little bit.
As we know Ubuntu editions comes with a version of RVM but unfortunately it doesn’t work correctly, so what we are going to do is that we will clean-up old stuffs if there is any!
It’s not a big deal, but we do need to get rid of it from the system before we start.

sudo apt-get remove --purge ruby-rvm ruby
sudo rm -rf /usr/share/ruby-rvm /etc/rmvrc /etc/profile.d/rvm.sh
# Check if there is anything

ls -d ~/.rvm*
ls -d ~/.gem*
ls -d ~/.bundle*

# Delete them (ignoring those that don’t exist)

rm -rf ~/.rvm* ~/.gem/ ~/.bundle*
First we’ll make sure that your system has all the prerequisite system utilities. There’s no harm in doing this gain if you’ve done it before. It will simply skip whatever has been installed previously.

sudo apt-get update

sudo apt-get install -y \
git \
build-essential \
curl \
wget

# For bash

echo "[[ -s '${HOME}/.rvm/scripts/rvm' ]] && source '${HOME}/.rvm/scripts/rvm'" >> ~/.bashrc
Note: The && is a way to say run this next command, but only if the previous command had no errors.
curl -L https://get.rvm.io | bash -s stable

source ~/.bashrc
rvm install ruby 1.9.3

rvm use --default 1.9.3