rbenv install fails building Ruby 2.1.2 on Ubuntu 14.04 LTS:
lsoave@basenode:~$ rbenv install 2.1.2 Downloading ruby-2.1.2.tar.gz... -> http://dqw8nmjcqpjn7.cloudfront.net/f22a6447811a81f3c808d1c2a5ce3b5f5f0955c68c9a749182feb425589e6635 Installing ruby-2.1.2... BUILD FAILED Inspect or clean up the working tree at /tmp/ruby-build.20140701125622.7217 Results logged to /tmp/ruby-build.20140701125622.7217.log Last 10 log lines: ruby-2.1.2/ruby_atomic.h /tmp/ruby-build.20140701125622.7217/ruby-2.1.2 /tmp/ruby-build.20140701125622.7217 ~ 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 `/tmp/ruby-build.20140701125622.7217/ruby-2.1.2': configure: error: C compiler cannot create executables See `config.log' for more details BUILD FAILED Inspect or clean up the working tree at /tmp/ruby-build.20140701125622.7217 Results logged to /tmp/ruby-build.20140701125622.7217.log Last 10 log lines: ruby-2.1.2/ruby_atomic.h /tmp/ruby-build.20140701125622.7217/ruby-2.1.2 /tmp/ruby-build.20140701125622.7217 ~ 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 `/tmp/ruby-build.20140701125622.7217/ruby-2.1.2': configure: error: C compiler cannot create executables See `config.log' for more details lsoave@basenode:~$
... it seems something about C compiler:
lsoave@basenode:~$ less /tmp/ruby-build.20140701130345.8077.log ... ... /tmp/ruby-build.20140701130345.8077/ruby-2.1.2 /tmp/ruby-build.20140701130345.8077 ~ 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 `/tmp/ruby-build.20140701130345.8077/ruby-2.1.2': configure: error: C compiler cannot create executables See `config.log' for more details
For some reasons my Ubuntu platform were missing some dependencies and by forcing the following installation, it solve the prblem:
sudo apt-get install autoconf bison build-essential libssl-dev libyaml-dev libreadline6 libreadline6-dev zlib1g zlib1g-dev
In particular I got installed the following extra packages:
automake autotools-dev g++ g++-4.8 libbison-dev libc6-dev libsigsegv2 libssl-doc libstdc++-4.8-dev linux-libc-dev m4
as well as the following NEW packages:
autoconf automake autotools-dev bison build-essential g++ g++-4.8 libbison-dev libc6-dev libsigsegv2 libssl-dev libssl-doc libstdc++-4.8-dev linux-libc-dev m4 zlib1g-dev
Now the bulid works fine:
lsoave@basenode:~$ rbenv install 2.1.2 Downloading ruby-2.1.2.tar.gz... -> http://dqw8nmjcqpjn7.cloudfront.net/f22a6447811a81f3c808d1c2a5ce3b5f5f0955c68c9a749182feb425589e6635 Installing ruby-2.1.2... Installed ruby-2.1.2 to /home/lsoave/.rbenv/versions/2.1.2 lsoave@basenode:~$ rbenv local 2.1.2 lsoave@basenode:~$ ruby -v ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-linux] lsoave@basenode:~$
Thanks @lgs :+1:
Awesome! Solved my problem, Thanks!
:+1: solved my problem too
rbenv install 2.3.1Downloading ruby-2.3.1.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.1.tar.bz2
error: failed to download ruby-2.3.1.tar.bz2
BUILD FAILED (Ubuntu 14.04 using ruby-build 20160913-13-g8ef0c34)
On following the commands that @lgs has mentioned, I got the following errors.
automake: error: no Automake input file found for 'autotools-dev'
automake: error: no Automake input file found for 'g++'
automake: error: no Automake input file found for 'g++-4.8'
automake: error: no Automake input file found for 'libbison-dev'
automake: error: no Automake input file found for 'libc6-dev'
automake: error: no Automake input file found for 'libsigsegv2'
automake: error: no input file found among supplied arguments
Any suggestions to what I can do ?
:+1: Solved my problem as well. Thank @lgs
I also faced this problem. This resource helped me to solve the problem.
https://www.digitalocean.com/community/tutorials/how-to-install-ruby-on-rails-with-rvm-on-ubuntu-18-04
Most helpful comment
For some reasons my Ubuntu platform were missing some dependencies and by forcing the following installation, it solve the prblem:
sudo apt-get install autoconf bison build-essential libssl-dev libyaml-dev libreadline6 libreadline6-dev zlib1g zlib1g-devIn particular I got installed the following extra packages:
as well as the following NEW packages:
Now the bulid works fine: