Ankit Pandey
Ankit Pandey

Reputation: 460

I am not able to install ruby via rvm

My Config log file is -

 ./configure
current path: /home/username/.rvm/src/ruby-2.1.6
PATH=/usr/local/jdk/bin:/home/username/perl5/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11R6/bin:/home/username/.rvm/bin:/home/username/bin:/home/username/.rvm/bin
command(4): ./configure --prefix=/home/username/.rvm/rubies/ruby-2.1.6 --disable-install-doc --enable-shared
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for gcc... gcc
checking whether the C compiler works... no
configure: error: in `/home/username/.rvm/src/ruby-2.1.6':
configure: error: C compiler cannot create executables
See `config.log' for more details

gcc already installed - 
gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-11)

Upvotes: 1

Views: 367

Answers (2)

kartik
kartik

Reputation: 686

I guess you do not have the required packages (dependencies) to install ruby via rvm. Following steps should help you out:

yum install gcc-c++ patch readline readline-devel zlib zlib-devel 
yum install libyaml-devel libffi-devel openssl-devel make 
yum install bzip2 autoconf automake libtool bison iconv-devel
curl -L get.rvm.io | bash -s stable
source /etc/profile.d/rvm.sh
rvm install 2.1.2
rvm use 2.1.2 --default

Now check your ruby version:

ruby --version

Check out http://tecadmin.net/install-ruby-2-1-on-centos-rhel/ for more details

Upvotes: 2

shevy
shevy

Reputation: 1000

There must be some problem with your host compiler GCC.

Another issue may be binutils.

At any rate, you should first try to see if you can compile other C-based programs.

I also recommend you wget ftp://ftp.ruby-lang.org/pub/ruby/2.2/ruby-2.2.2.tar.xz extract it and have a look what happens if you compile it (you can compile into an /opt prefix for now; you can use rvm lateron anyway; ./configure --prefix=/opt/ruby/2.2.2; make; make install)

This may possibly fail, have a look at config.log then. Often, but not always, config.log will have the specific error.

I assume that your compile toolchain is not complete.

Upvotes: 0

Related Questions