rbenv ruby install fail ubuntu - ruby

Here is the error log
Downloading ruby-2.2.0.tar.gz... -> http://dqw8nmjcqpjn7.cloudfront.net/7671e394abfb5d262fbcd3b27a71bf78737c7e9347fa21c39e58b0bb9c4840fc
Installing ruby-2.2.0...
BUILD FAILED (Ubuntu 14.04 using ruby-build 20141225-7-g4aeeac2)
Inspect or clean up the working tree at /tmp/ruby-build.20150106233051.25615 Results logged to /tmp/ruby-build.20150106233051.25615.log
Last 10 log lines:
compiling ossl_x509store.c
compiling ossl_engine.c
compiling ossl_ocsp.c
compiling ossl_config.c
compiling ossl_digest.c
installing default openssl libraries
linking shared-object openssl.so
make[2]: Leaving directory /tmp/ruby-build.20150106233051.25615/ruby-2.2.0/ext/openssl'
make[1]: Leaving directory/tmp/ruby-build.20150106233051.25615/ruby-2.2.0'
make: *** [build-ext] Error 2
I'm not sure what to do here. I tried this but when I type ruby -v it still tells me I have the old version.
sudo apt-get install autoconf bison libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm3 libgdbm-dev
Thanks for any comments given, much appreciated.

install these dependencies first and then retry worked for me on 14.04 for ruby 2.2.0 with rbenv
sudo apt-get install autoconf bison build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm3 libgdbm-dev

All of other anwsers failed for me...
and after lot of failed attempts and research I found out those workarounds for many versions:
2.1.1
curl -fsSL https://gist.github.com/mislav/a18b9d7f0dc5b9efc162.txt | rbenv install --patch 2.1.1
2.0.0-p451
curl -fsSL https://gist.github.com/LeonB/10503374/raw | rbenv install --patch 2.0.0-p451
2.0.0-p247
cat <(curl -fsSL https://raw.githubusercontent.com/wayneeseguin/rvm/master/patches/ruby/changeset_r45225.diff) <(curl -fsSL https://raw.githubusercontent.com/wayneeseguin/rvm/master/patches/ruby/changeset_r45240.diff) | sed -E 's/^((---|\+\+\+) )(a|b)\/([^ ]+\s+\(revision [0-9]+\))$/\1\4/' | sed '/rl_delete_text/d' | rbenv install -p 2.0.0-p247
Source: https://github.com/sstephenson/ruby-build/issues/526
Hope i could help anyone.

If you are using Ubuntu and or Debian than you can try to install libffi-dev via apt-get.
$ apt-get install libffi-dev
I did a little research around the forums and I found this on the official rbenv Question and Answer section.
https://github.com/sstephenson/ruby-build/wiki#build-failure-of-fiddle-with-ruby-220

Related

make: *** [Makefile:1280: install] Error 1

OS Ubuntu 20.04.3
Python intalation 3.10.2
error: make: *** [Makefile:1280: install] Erro 1 after sudo make install
make: latest version
what should I do?
This is the full set of steps which worked for me. to install
# python3 --version
Python 3.10.4
In Ubuntu 21.10:
$ sudo apt install build-essential
$ sudo apt install libssl-dev libffi-dev libncurses5-dev zlib1g zlib1g-dev libreadline-dev libbz2-dev libsqlite3-dev make gcc
$ cd /to/extracted/folder
$ ./configure
$ make
$ sudo make install
Common errors if you do not follow this process:
Critical dependencies were missing:
[Makefile:1280: install] Erro 1
Ran 'make' before all dependencies were met but it didn't fail to compile (have to install all packages then make clean then make):
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Collecting <package>
Could not fetch URL https://pypi.python.org/simple/<package>/: There was a problem confirming the ssl certificate: Can't connect to HTTPS URL because the SSL module is not available. - skipping
Could not find a version that satisfies the requirement <package> (from versions: )
No matching distribution found for <package>
You have to install dependencies (libraries) to be able build python from source code:
sudo apt install libssl-dev libffi-dev libncurses5-dev zlib1g zlib1g-dev libreadline-dev libbz2-dev libsqlite3-dev make gcc

Conflicting packages on ubuntu

I was installing Sass on ubuntu for that I first installed Ruby and then Sass. but when i tried sass -v it gave a deprecated message about currently install ruby1.9 version saying it will not be support in future. so i tried upgrading ruby version to 2.0 (2.3 is not being installed on ubuntu) using
$ sudo apt-get install ruby2.0
But when checking the ruby version it still showed 1.9 so i tried with UN-installing Ruby1.9 then it showed a dependent library to uninstalled. I even did that but after that on installing ruby 2.0 again it gives error
the following packages have unmet dependencies:
libantlr3c-antlrdbg-3.2-0 : Conflicts: libantlr3c-3.2-0
E: Unable to correct problems, you have held broken packages.
How to solve this??
Basically you should install it directly from source, like so:
sudo apt-get -y update
sudo apt-get -y install build-essential zlib1g-dev libssl-dev
libreadline6-dev libyaml-dev
cd /tmp
wget http://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p451.tar.gz
tar -xvzf ruby-2.0.0-p451.tar.gz
cd ruby-2.0.0-p451/
./configure --prefix=/usr/local
make
sudo make install
Solution found here.

Build failed error when trying to install ruby v 2.2.2 with rbenv on ubuntu 14.04.3 LTS

I was trying to install ruby v2.2.2 after having installed rbenv but I got this error. I am pretty new to Ubuntu and Ruby and wanted to know if there was a way to fix this. Thank you.
BUILD FAILED (Ubuntu 14.04 using ruby-build 20150818-4-g8d6ff29)
Inspect or clean up the working tree at /tmp/ruby-build.20150922205847.10469
Results logged to /tmp/ruby-build.20150922205847.10469.log
Last 10 log lines:
checking for gmp.h... no
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... 64
checking whether byte ordering is bigendian... no
checking for an ANSI C-conforming const... yes
checking whether char is unsigned... no
checking for inline... no
checking for working volatile... no
checking for typeof syntax and keyword spelling... __typeof__
configure: error: ANSI C-conforming const and volatile are mandatory
I have also done the following, but to no avail:
udo apt-get install autoconf bison build-essential libssl-dev libyaml-dev libreadline6 libreadline6-dev zlib1g zlib1g-dev
This is caused by GCC version mismatch. You have GCC version that is "too new" for this particular Ruby version. Here's how to overcome this problem.
rbenv
CFLAGS="-O2 -fno-tree-dce -fno-optimize-sibling-calls" rbenv install [your-version]
rvm
CFLAGS="-O2 -fno-tree-dce -fno-optimize-sibling-calls" rvm install [your-version]
The issue seems to arise from missing packages.
This article details how to "Setup Ruby On Rails on Ubuntu 14.04 Trusty Tahr". Your question is answered in the "Installing Ruby" section of the article.
To begin, install all the dependencies.
sudo apt-get update
sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev
Now you can use rbenv to install ruby:
rbenv install 2.2.2

RVM installed but not working?

I installed RVM on my Fedora 19 system a few months ago, and it was working fine. Then I had some other work and when I opened the machine again, it said:
# rvm
bash: rvm: command not found...
I tried to reinstall RVM, and this is what I get:
# rpm -i rvm-devel-1.17-8.fc19.x86_64.rpm
package rvm-devel-1.17-8.fc19.x86_64 is already installed
But I can't find it.
# ps ax | grep rvm
14363 pts/0 S+ 0:00 grep --color=auto rvm
Can anyone help me? What exactly is the problem?
P.S: The package rvm is there on the system.
# rpm -q rvm
rvm-1.17-8.fc19.x86_64
I recommend you to reinstall RVM, maybe it's crashed due to some event.
Use this command to implode it:
rvm implode
Or:
rm -rf ~/.rvm
Then install it by running:
sudo apt-get install curl
curl -L get.rvm.io | bash -s stable --auto
Then you'll need to reload the ~/.bash_profile file which you can do with this small command:
. ~/.bash_profile
Make sure to install other packages needed for Ruby to work:
sudo apt-get install build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion pkg-config
sudo apt-get install pkgconfig
Now install the latest Ruby:
rvm install 2.0.0
rvm use 2.0.0
ruby -v
Now you can install Rails:
gem install rails -v 4.0.0
the package rvm-devel-1.17-8.fc19.x86_64 is not rvm as per http://rpm.pbone.net/index.php3/stat/4/idpl/20537074/dir/fedora_19/com/rvm-devel-1.17-8.fc19.x86_64.rpm.html it is:
The rvm-devel package contains libraries and header files for
developing applications that use rvm.
Follow installation instructions http://rvm.io/rvm/install to get RVM installed, make sure to read the outputs as important hints might be printed for you.
to uninstall rvm use anyone of the following:
rvm implode
or
rm -rf ~/.rvm
Just to be sure restart the terminal before you try installing rvm again

Installing OpenSSL on Ubuntu for Rails development?

I am running the latest RVM on Ubuntu 10.10 and I managed to get most of the development environment running, except for OpenSSL.
When I try to install the package I get the following error:
$ rvm package install openssl > error
ERROR: Error running 'tar zxf /home/ruby/.rvm/archives/openssl-0.9.8n.tar.gz -C
/home/ruby/.rvm/src', please read /home/ruby/.rvm/log/openssl/extract.log
ERROR: Error running './config -I/home/ruby/.rvm/usr/include -L/home/ruby/.rvm
/usr/lib
--prefix=/home/ruby/.rvm/usr zlib no-asm no-krb5 shared ', please read /home/ruby
/.rvm/log/openssl/configure.log
ERROR: Error running '/usr/bin/make ', please read /home/ruby/.rvm/log/openssl/make.log
ERROR: Error running '/usr/bin/make install', please read /home/ruby/.rvm/log/openssl
/make.install.log
It seems that the original downloaded file is corrupt when I get it via RVM. So, I downloaded and unpacked it to ~/.rvm/src/openssl0.9.8 and the first error is gone (error running tar zxf), but I still get the other ones.
Edit: my Ruby version, if anyone cares, is:
$ ruby -v
ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-linux]
Did you run rvm requirements after installing RVM? It shows a list of all needed dependencies, and supplies the recommended "apt-get" command.
/usr/bin/apt-get install build-essential bison openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev
This will install openssl and libssl-dev, both of which are required. I've installed RVM and Ruby many times on Ubuntu and always used RVM's recommended way without a problem.
Do you have libssl installed in Ubuntu?
sudo apt-get install libssl0.9.8
Also install the development package:
sudo apt-get install libssl-dev

Resources