Issue installing 1.8.7 p358 under RVM - ruby

After getting Xcode rvm install 1.9.3 works totally fine. However, rvm install 1.8.7 throws the following error.
~ ☺ rvm install 1.8.7
Installing Ruby from source to: /Users/jordanscales/.rvm/rubies/ruby-1.8.7-p358, this may take a while depending on your cpu(s)...
ruby-1.8.7-p358 - #fetching
ruby-1.8.7-p358 - #extracting ruby-1.8.7-p358 to /Users/jordanscales/.rvm/src/ruby-1.8.7-p358
Error running 'tar xjf /Users/jordanscales/.rvm/archives/ruby-1.8.7-p358.tar.bz2 -C /Users/jordanscales/.rvm/tmp/rvm_src_30581 ', please read /Users/jordanscales/.rvm/log/ruby-1.8.7-p358/extract.log
There has been an error while trying to extract the source.
Halting the installation.
There has been an error fetching the ruby interpreter. Halting the installation.
Please be aware that you just installed a ruby that requires 2 patches just to be compiled on up to date linux system.
This may have known and unaccounted for security vulnerabilities.
Please consider upgrading to Ruby 1.9.3-194 which will have all of the latest security patches.
~ ☺
The log reads
[2012-06-04 17:06:23] tar xjf /Users/jordanscales/.rvm/archives/ruby-1.8.7-p358.tar.bz2 -C /Users/jordanscales/.rvm/tmp/rvm_src_30581
ruby-1.8.7-p358/lib/test/unit/ui/gtk/testrunner.rb: (Empty error message)
tar: Error exit delayed from previous errors.
Any idea how to fix? I've tried rvm get head, installing gcc-4.2 and using that, using clang, etc. But nothing seems to work.

Make sure to satisfy all requirements specified by:
rvm requirements
Including Xcode 4.1 or osx-gcc-installer
Run (to fix broken download):
rvm cleanup archives
and try again:
rvm reinstall 1.8.7
Is there any reason why you are going with 1.8.7? it's about at end of life and 1.9.3 should be used instead if this is not an requirement.

Related

Can't install ruby 1.8.7 Mac OS X Sierra

I'm trying to (re-)install ruby 1.8.7 using rvm 1.29.1 on a brand new MBP running OS X Sierra. I HAVE to get this done for work, I'm not in a position to switch to a more current version or anything unfortunately.
I had a functional install of this but after getting some weird errors in a project decided to try a completely clean reinstall of both rvm (and eventually homebrew!) (long story- had a broken file structure after removing an unwanted space from the name of my home directory!). I was careful to remove all traces of the old install from .bashrc, .profile etc following other posts on here. 2.4.0 installs and runs fine. However, on trying to install 1.8.7:
9bxbniv1:~ Rob$ rvm install ruby-1.8.7
Warning! Requested ruby installation which requires another ruby available - installing ruby-1.8.7-p374 first.
ruby-1.8.7-p374 - #removing src/ruby-1.8.7-p374..
Checking requirements for osx.
Certificates in '/usr/local/etc/openssl#1.1/cert.pem' are already up to date.
Requirements installation successful.
Installing Ruby from source to: /Users/Rob/.rvm/rubies/ruby-1.8.7-p374, this may take a while depending on your cpu(s)...
ruby-1.8.7-p374 - #downloading ruby-1.8.7-p374, this may take a while depending on your connection...
ruby-1.8.7-p374 - #extracting ruby-1.8.7-p374 to /Users/Rob/.rvm/src/ruby-1.8.7-p374....
ruby-1.8.7-p374 - #applying patch /Users/Rob/.rvm/patches/ruby/1.8.7/stdout-rouge-fix.patch.
ruby-1.8.7-p374 - #applying patch /Users/Rob/.rvm/patches/ruby/1.8.7/no_sslv2.diff.
ruby-1.8.7-p374 - #applying patch /Users/Rob/.rvm/patches/ruby/GH-488.patch.
ruby-1.8.7-p374 - #applying patch /Users/Rob/.rvm/patches/ruby/ssl_no_ec2m.patch.
ruby-1.8.7-p374 - #configuring...............................
ruby-1.8.7-p374 - #post-configuration.
ruby-1.8.7-p374 - #compiling................................
Error running '__rvm_make -j 1',
showing last 15 lines of /Users/Rob/.rvm/log/1488471654_ruby-1.8.7-p374/make.log
^
openssl_missing.c:107:28: error: dereferencing pointer to incomplete type
EVP_MD_CTX_cleanup(&ctx->o_ctx);
^
openssl_missing.c:108:28: error: dereferencing pointer to incomplete type
EVP_MD_CTX_cleanup(&ctx->md_ctx);
^
In file included from /usr/include/string.h:192:0,
from openssl_missing.c:19:
openssl_missing.c:109:27: error: invalid application of 'sizeof' to incomplete type 'HMAC_CTX'
memset(ctx, 0, sizeof(HMAC_CTX));
^
make[1]: *** [openssl_missing.o] Error 1
make: *** [all] Error 1
+++ return 2
There has been an error while running make. Halting the installation.
To proceed rvm requires a ruby-1.8.7-p374 compatible ruby is installed.
We attempted to install it automatically but it failed with status 2.
Please install it manually (or a compatible alternative) to proceed.
I have tried some of the hacks suggested in Getting Ruby 1.8.7 installed on Mountain Lion (10.8) but unfortunately that didn't help.
Looking further into the log file the error begins with the following message:
In file included from openssl_missing.c:22:0:
openssl_missing.h:79:35: error: macro "EVP_MD_CTX_create" passed 1 arguments, but takes just 0
EVP_MD_CTX *EVP_MD_CTX_create(void);
^
In file included from /usr/local/opt/openssl#1.1/include/openssl/x509.h:23:0,
from /usr/local/opt/openssl#1.1/include/openssl/x509_vfy.h:17,
from openssl_missing.c:16:
/usr/local/opt/openssl#1.1/include/openssl/evp.h:501:51: error: expected declaration specifiers or '...' before '(' token
# define EVP_MD_CTX_init(ctx) EVP_MD_CTX_reset((ctx))
Searching for the first line of this error returned 0 results on here. Suggestions would be gratefully received.
I was able to get this working via RVM using a variant of rbenv code I found # https://gist.github.com/davidkellis/909449e13905d8bfbd49c30d20f7fbca . I already had xcode and openssl.
rvm install 1.8.7 --with-openssl-dir=`brew --prefix openssl`
The latest development version of RVM should work:
rvm get head
I also updated XCode to version 8.2.1 before I upgraded RVM, if you do upgrade XCode you'll need to launch it and agree the new license or:
sudo xcodebuild -license
I had to upgrade my brew as well and do loads to get it working as it hadn't been touched for a very long time.
I'm not sure if you could just do one in isolation. Mine is up and running now.
I nuked my RVM as I had let it get out of hand. Wish I had just pruned it instead. Now to get the legacy Rails apps up and running.
Ruby 1.8.7 is dead and no longer supported on any modern macOS, so you can't install it. That version of Ruby is a historical artifact at this point, and if you really, really do need to run it, you'll either need to get a historical version of OS X, Linux or BSD which is compatible with it.
My advice is to use Vagrant to build a virtual machine that has an older version of Linux or BSD which can be used to build Ruby 1.8.7. Anything dating from 2010 or earlier will probably work, so Ubuntu 10.04 might be a good place to start.
It's worth noting that Ruby Enterprise Edition is a variant of 1.8.7 that was supported longer than MRI 1.8.7 was, so you may have more success with that version. It was discontinued in 2012.
I ended up restoring my system using time machine. But another colleague had the same problems setting things up on a new machine, and found
rvm install ruby -v 1.8.7--autolibs=enable
helpful, if anyone else stumbles across this.

Why is reinstalling Ruby 1.8.7 failing

I tried to reinstall Ruby 1.8.7 using RVM after having troubles with Homebrew. I reinstalled Homebrew and RVM, and I have Ruby 1.9.3 and 2.0.0 working fine.
One of my projects uses 1.8.7 so when I used:
rvm install 1.8.7
I got:
The requested url does not exist(22):'http://production.cf.rubygems.org/rubygems/rubygems-2.0.9.tgz'
Checking fallback: ftp://production.cf.rubygems.org/rubygems/rubygems-2.0.9.tgz
Checking fallback: http://www.mirrorservice.org/sites/production.cf.rubygems.org/rubygems/rubygems-2.0.9.tgz
No fallback URL could be found, try increasing timeout with:
echo "export rvm_max_time_flag=20" >> ~/.rvmrc
There has been an error while trying to fetch rubygems.
Halting the installation.
I tried to do:
rvm get stable
rvm get head
curl -L get.rvm.io | bash -s stable
Which I found on another Stack Overflow question with a similar error, but it's obviously a bit different.
I run:
RVM 1.22.9 (stable)
Homebrew 0.9.4
Mac OSX 10.8.4
This was an issue with rubygems release process - https://github.com/wayneeseguin/rvm/issues/2212 and https://github.com/rubygems/rubygems/issues/651
For next time it happens you can specify which version of rubygems to use when installing ruby with rvm like this:
rvm install 1.8.7 --rubygems 2.0.8
I'm seeing essentially the same error with a chef deploy of rvm under ubuntu - ruby 1.8.7 refuses to complete installation (the ruby is there, but no gem, etc) due to a problem with 'rubygems-2.0.9.tgz'
Edited to add - if you run 'rvm rubygems 2.0.7' (latest that seems to be really available right now) it seems to work.

RVM keeps setting up ruby 1.8.7 instead of the latest version 1.9 in MAC

I cannot install ruby properly using RVM..
The error says:
No binary rubies available for: downloads/ruby-1.9.3-p327.
Continuing with compilation. Please read 'rvm mount' to get more information on binary rubies.
Fetching yaml-0.1.4.tar.gz to /Users/xiruki/.rvm/archives
Extracting yaml to /Users/xiruki/.rvm/src/yaml-0.1.4
Configuring yaml in /Users/xiruki/.rvm/src/yaml-0.1.4.
Error running './configure --prefix=/Users/xiruki/.rvm/usr', please read /Users/xiruki/.rvm/log/ruby-1.9.3-p327/yaml/configure.log
Compiling yaml in /Users/xiruki/.rvm/src/yaml-0.1.4.
Error running 'make', please read /Users/xiruki/.rvm/log/ruby-1.9.3-p327/yaml/make.log
Installing Ruby from source to: /Users/xiruki/.rvm/rubies/ruby-1.9.3-p327, this may take a while depending on your cpu(s)...
ruby-1.9.3-p327 - #downloading ruby-1.9.3-p327, this may take a while depending on your connection...
ruby-1.9.3-p327 - #extracted to /Users/xiruki/.rvm/src/ruby-1.9.3-p327 (already extracted)
ruby-1.9.3-p327 - #configuring
Error running './configure --enable-shared --disable-install-doc --prefix=/Users/xiruki/.rvm/rubies/ruby-1.9.3-p327 --with-opt-dir=/Users/xiruki/.rvm/usr', please read /Users/xiruki/.rvm/log/ruby-1.9.3-p327/configure.log
There has been an error while running configure. Halting the installation.
What could be the problem? Please bear with me because I am new to MAC.
I am trying to install ruby 1.9.3
But it sticks to ruby 1.8.7 after i installed RVM via curl command.
whenever i try to install ruby 1.9.3 using rvm install command... it keeps on displaying errors.
Do the following:
I too recommend you make sure to read rvm requirements but here's the gist of it for your convenience.
Upgrade to the latest Xcode, launch it, go to Preferences -> Downloads -> click "Install" for "Command Line Tools".
Install homebrew if you don't already have it. Then:
brew update
brew upgrade
brew install git
If you need to install rubies older than 1.9.3 do the following:
brew tap homebrew/dupes
brew install autoconf automake apple-gcc42
rvm pkg install openssl
At this point you should rvm reinstall all of your rubies so they're compiled against all of your new stuff. Be sure to then run rvm use [RUBY] --default to use that ruby and make it the default one.
You need a compiler. Xcode command line tools or gcc. You probably have homebrew installed. I recommend you run brew doctor and follow the instructions.
You also must add a line to your bash file. This commands does that for you:
echo "source $HOME/.rvm/scripts/rvm" >> ~/.bash_profile
After that you should be good.
UPDATE:
Instead of installing Xcode see what this command tells your to do:
rvm requirements
I don't use rvm at the moment but it seems your will be better with gcc wich that command tells you to install.

Trouble installing ruby with RVM. Database file does not exist?

Running into big problems at step one. I got RVM installed, then typed "rvm install 1.9.3" and here's the output:
David-Coles-MacBook-Air:~ DavesPiece$ rvm install 1.9.3
Fetching yaml-0.1.4.tar.gz to /Users/DavesPiece/.rvm/archives
Extracting yaml-0.1.4.tar.gz to /Users/DavesPiece/.rvm/src
Configuring yaml in /Users/DavesPiece/.rvm/src/yaml-0.1.4.
Error running ' ./configure --prefix="/Users/DavesPiece/.rvm/usr" ', please read /Users/DavesPiece/.rvm/log/ruby-1.9.3-p194/yaml/configure.log
Compiling yaml in /Users/DavesPiece/.rvm/src/yaml-0.1.4.
Error running 'make ', please read /Users/DavesPiece/.rvm/log/ruby-1.9.3-p194/yaml/make.log
Database file /Users/DavesPiece/.rvm/config/packages does not exist.
Installing Ruby from source to: /Users/DavesPiece/.rvm/rubies/ruby-1.9.3-p194, this may take a while depending on your cpu(s)...
ruby-1.9.3-p194 - #fetching
ruby-1.9.3-p194 - #extracted to /Users/DavesPiece/.rvm/src/ruby-1.9.3-p194 (already extracted)
ruby-1.9.3-p194 - #configuring
Error running ' ./configure --prefix=/Users/DavesPiece/.rvm/rubies/ruby-1.9.3-p194 --enable-shared --disable-install-doc --with-libyaml --with-opt-dir=/Users/DavesPiece/.rvm/usr ', please read /Users/DavesPiece/.rvm/log/ruby-1.9.3-p194/configure.log
There has been an error while running configure. Halting the installation.
ls: /Users/DavesPiece/.rvm/rubies/*/bin/ruby: No such file or directory
David-Coles-MacBook-Air:~ DavesPiece$
I went and read the log files it mentioned but that lead nowhere. Any idea what I should do? I've practically Googled my face off and can't find a solution.
this looks suspicious, how did you installed RVM ?
the simplest solution is to:
touch /Users/DavesPiece/.rvm/config/packages
If you don't have Xcode, you'll need to install it. If you have Lion 10.7.3 or above you can find it in the App Store. Otherwise, you will need to go to the Apple Developer site (requires account) to find instructions for downloading and installing it.
Also, if you're on Lion, you may need to download and install GCC-10.7-v2.pkg. If you see a message about your compiler being LLVM based, you may need to use this command instead:
CC=/usr/bin/gcc-4.2 rvm install 1.9.2-p290 --enable-shared
Without having seen your configure.log this is just a best guess.
Can't install Ruby under Lion with RVM – GCC issues

ruby 1.9.2 installations error on rvm

I tried to install ruby 1.9.2 on rvm, but after the computer compiles for a while, the system says error message on Terminal. Do you know what the matter is? It's taking me hours :(
ruby-1.9.2-head - #fetching
HEAD is now at 91799a2 merges r30786, r30787 and r30797 from trunk into ruby_1_9_2.
From https://github.com/ruby/ruby
* branch ruby_1_9_2 -> FETCH_HEAD
Already up-to-date.
Copying from repo to src path...
Running autoconf
ruby-1.9.2-head - #configuring
ruby-1.9.2-head - #compiling
ERROR: Error running 'make ', please read /Users/nofear38/.rvm/log/ruby-1.9.2-head/make.log
ERROR: There has been an error while running make. Halting the installation.
Run rvm notes and ensure that OS dependencies are installed.
Do you have the build tools from XCode installed? You will need them if you want to make things.
The error output is specifically saying to read /Users/nofear38/.rvm/log/ruby-1.9.2-head/make.log. What does that log file tell you about the error? That might tell you exactly what the problem is.
If not, what command did you use when you installed RVM?
Are you following the Installation Methods or some other instructions? All too often we find people have either followed the wrong directions, didn't follow the directions completely, or are using the system-wide installation instead of the single-user's sandbox.
The command output you show is not what I see when installing Ruby via RVM for the current 1.9.2 install. If you used:
rvm install 1.9.2-head
I recommend instead you use:
rvm install 1.9.2
which will pull in 1.9.2-p180, which is the current stable branch, rather than the latest bleeding-edge version.
In case you haven't solved this problem, I'm running Ubuntu 11.0 and I used sudo apt-get install ruby-rvm and rvm installed perfectly!

Resources