Could not install Ruby 2.0 because Openssl.org down? - ruby

I tried to install ruby-2.0.0-p0 on Macintosh at several times. But I never success. I tried brew install openssl or rvm pkg install openssl but progress bar is always 0% and I never access to www.openssl.org. There are no way to install them without openssl. Is this only my probrem? I found any similar resources but there are not help for me... Am I banned from Openssl? Or it is not only my problem? Could you someone tell me any good advice?
EDIT
Thanks #fmendez, But I hit same error again... Full trace on Gist
==> Downloading http://openssl.org/source/openssl-1.0.1e.tar.gz
Error: Download failed: http://openssl.org/source/openssl-1.0.1e.tar.gz
$ brew install openssl
==> Downloading http://openssl.org/source/openssl-1.0.1e.tar.gz
0.0%
curl: (7) couldn't connect to host
Error: Download failed: http://openssl.org/source/openssl-1.0.1e.tar.gz
EDIT
Finally I've connected openssl.org. I didn't know what was the problem :\
Sorry for any attentions. I will delete this.

The url pointed to by the latest openssl brew formula is: http://openssl.org/source/openssl-1.0.1e.tar.gz and it is working fine. Try doing a brew update, then the following:
rvm get head
rvm pkg remove
rvm requirements run
rvm reinstall 2.0.0
Note
After running the rvm requirements make sure you install any library hinted by homebrew if any.

Related

Trouble installing Ruby (Failed to download resource "readline--patch")

I'm getting this error when I try to install Ruby. I've tried looking at this and this but to no avail
➜ ~ brew install ruby
Warning: You are using OS X 10.12.
We do not provide support for this pre-release version.
You may encounter build failures or other breakages.
Please create pull-requests instead of filing issues.
==> Installing dependencies for ruby: readline, libyaml, makedepend
==> Installing ruby dependency: readline
==> Downloading https://ftpmirror.gnu.org/readline/readline-6.3.tar.gz
==> Downloading from http://mirror.team-cymru.org/gnu/readline/readline-6.3.tar.gz
######################################################################## 100.0%
==> Downloading https://gist.githubusercontent.com/jacknagel/d886531fb6623b60b2af/
curl: (22) The requested URL returned error: 404 Not Found
Error: Failed to download resource "readline--patch"
Download failed: https://gist.githubusercontent.com/jacknagel/d886531fb6623b60b2af/raw/746fc543e56bc37a26ccf05d2946a45176b0894e/readline-6.3.8.diff
I've met the same problems when I installed Ruby on my Mac. Maybe you could try the following steps to solve this problem, it works for me :)
update your brew, paste /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" at a Terminal prompt. (or following instructions on brew homepage) Or just brew update
Run brew install ruby
Good luck to you! :)

Can't install imagemagick with brew on Mac OS X mavericks

I am using Homebrew v0.9.5 on my Mac OS X version 10.9.4
When I run the command: `brew install imagemagick, this error occurred.
$ brew install imagemagick
==> Installing dependencies for imagemagick: libpng, freetype
==> Installing imagemagick dependency: libpng
==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/libpng-1.6.12.mavericks.bottle.tar.gz
curl: (7) Failed connect to downloads.sf.net:443; Operation timed out
Error: Failed to download resource "libpng"
Download failed: https://downloads.sf.net/project/machomebrew/Bottles/libpng-1.6.12.mavericks.bottle.tar.gz
Warning: Bottle installation failed: building from source.
==> Downloading https://downloads.sf.net/project/libpng/libpng16/1.6.12/libpng-1.6.12.tar.gz
curl: (7) Failed connect to downloads.sf.net:443; Operation timed out
Error: Failed to download resource "libpng"
Download failed: https://downloads.sf.net/project/libpng/libpng16/1.6.12/libpng-1.6.12.tar.gz
I have added --disable-openmp option, it also doesn't go well.
$ brew install imagemagick --disable-openmp
brew doctor command result has no problem.
$ brew doctor
Your system is ready to brew.
Have you tried a
$ brew update
$ brew install imagemagick --disable-openmp --build-from-source
Apparently that seemed to fix it for me on Mac OS 10.8 (Mountain Lion). Previously I checked out the latest imagemagick brew recipe with "brew versions imagemagick" and "git checkout e68e443", see here and here
I'm not certain whether the source of my problem was the same as the OP's, however (though this has an accepted answer already) I'll post this in case this solution works for others.
Using brew install imagemagick, I would encounter the following error:
curl: (52) Empty reply from server Error: Failed to download resource
"libpng" Download failed:
https://downloads.sf.net/project/libpng/libpng16/1.6.16/libpng-1.6.16.tar.xz
Which is similar, if less specific than the OP's message.
As it turned out, I already had a previous version of libpng installed (version 1.5.7). I then ran:
brew upgrade libpng
Followed by another brew install libpng, and this time it succeeded, as it now had the correct version needed.
This problem also occurs because https://downloads.sf.net/project/libpng/libpng16/1.6.16/libpng-1.6.16.tar.xz has a badly configured SSL certificate. Open the link in your browser and see if your browser complains.
If that's the case, you can manually download the file to /Library/Caches/Homebrew and run again.
Source: https://github.com/Homebrew/homebrew/issues/36703
For me it was upgrading to El Capitan. I found the simplest solution was to force remove homebrew:
sudo ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
then to re-install it:
sudo /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
then install imageMajick:
brew install ImageMagick
Depending on your setup you may not want to sudo. For me, its fine. Enjoy a snack while you manipulate images.
In my case the url was simply not correct, with which homebrew wanted to download the required file. I looked it up here http://sourceforge.net/projects/libpng/files/libpng16/older-releases/1.6.16/ by myself and copied it to /Library/Caches/Homebrew like #Dan suggested.
I then run brew install libpng again and it worked.
Follow this:
brew install imagemagick#6
Add below lines in to ~/.bash_profile file
export LDFLAGS="-L/usr/local/opt/imagemagick#6/lib" export
CPPFLAGS="-I/usr/local/opt/imagemagick#6/include" export
PKG_CONFIG_PATH="/usr/local/opt/imagemagick#6/lib/pkgconfig"
Install Rmagick
source ~/.bash_profile
gem install rmagick
If you are an Anaconda/Miniconda user on Mac OSX or Linux, you can install packages like imagemagick using conda.
conda install -c conda-forge imagemagick
https://anaconda.org/conda-forge/imagemagick

Homebrew (Mac): cannot install libksba or dependency libgpg-error

I'm setting up a new Mac for development with Ruby on Rails. I have installed XCode (including command line tools), Homebrew, and RVM properly. However, when I try to install the 2.0.0 Ruby version via RVM, I keep having to install libksba, which tries to install the dependency libgpg-error. The log tells me it's downloading the file, but it never does anything. I've let it run for 30 minutes before and still doesn't do anything. The file is supposed to be a few hundred KB, so it's not very large...Below is the code I'm running:
$ brew install libksba
==> Installing libksba dependency: libgpg-error
==> Downloading ftp://ftp.gnupg.org/gcrypt/libgpg-error/libgpg-error-1.11.tar.bz
This will just sit there and do nothing. Is there another repository where I can download the file from and manually install it? It's frustrating to not be able to develop because of simple dependency errors. Any suggestions would be greatly appreciated.
These are the formulas associated with libksba and libpgp-error: Homebrew Libksba Formula and Homebrew Libgpg-Error. Try first updating Homebrew, since the discrepancy between the version shown in your logs and the one in the repo tells me is outdated:
brew update
brew install libksba
If that doenst work, then you can download it from here:
url 'ftp://ftp.gnupg.org/gcrypt/libksba/libksba-1.3.0.tar.bz2'
url 'ftp://ftp.gnupg.org/gcrypt/libgpg-error/libgpg-error-1.11.tar.bz2'
mirror 'http://www.mirrorservice.org/sites/ftp.gnupg.org/gcrypt/libgpg-error/libgpg-error-1.11.tar.gz'
So I found out the problem; my network is running through a 2nd router that was blocking FTP. I skipped the 2nd router and connected to the primary router and brew install libksba worked just fine. Credit goes to fmendez who provided a mirror link that led me to check out the router ports for FTP.
For others coming to this question, the above instructions do work for manually downloading and installing the formulas. I also recommend checking out Homebrew Tips n Tricks for additional help on which commands to run.
You can try the following steps ( Ref from here )
cd /usr/local/src
curl -O ftp://ftp.gnupg.org/gcrypt/libgpg-error/libgpg-error-1.9.tar.gz
tar -xvf libgpg-error-1.9.tar.gz
cd libgpg-error-1.9/
./configure
make
make install
cd ..
curl -O ftp://ftp.gnupg.org/gcrypt/libksba/libksba-1.2.0.tar.bz2
tar -xvf libksba-1.2.0.tar.bz2
cd libksba-1.2.0/
./configure
make
make install

Ruby and "You must recompile Ruby with OpenSSL support or change the sources in your Gemfile"

Using rvm I upgraded my ruby to 1.9.3-p392, also added 2.0.0, anytime I try to use this version when I run my bundle command I get this error.
Could not load OpenSSL.
You must recompile Ruby with OpenSSL support or change the sources in your Gemfile from 'https' to 'http'. Instructions for compiling with OpenSSL using RVM are
available at rvm.io/packages/openssl.
I have followed several different instructions on how to fix this. I have tried removing the version and installing it with the rvm options
--with-openssl-dir=$HOME/.rvm/usr
I have installed OpenSSL with rvm, and macports. Both have not helped the problem. I even changed the file location of the ssl cert using this:
export SSL_CERT_FILE=/Users/DarkLord/.rvm/usr/ssl/cert.pem
No matter what I do I continue to get the error.
Can someone please help me fix this?
This works for me:
rvm get stable
brew install libyaml
rvm pkg install openssl
rvm install ruby-2.0.0 --with-openssl-dir=$HOME/.rvm/usr
rvm use ruby-2.0.0
All credits go to https://coderwall.com/p/tptocq
This helps me install 1.9.3-head on Mac:
rvm get latest
brew install openssl
rvm reinstall 1.9.3-head --with-openssl-dir=`brew --prefix openssl`
In my case after:
1. brew install openssl
2. rvm install ruby-2.6.0
bundle install failed with this error. The problem was that openssl was globally set so I had to install the new ruby version by setting the openssl directory explicitly.
So what I had to do was:
1. rvm reinstall ruby-2.6.0 --with-openssl-dir=/usr/local/opt/openssl
2. rvm reload
Assuming that usr/local/opt/openssl is where it is installed.
After that bundle install ran successfully.
Warning when I tried this command with this path /usr/local like some answers suggested, it didn't work.
To get this working again I had to install homebrew and move my mac ports out of the way. Then do the following after removing 1.9.3-p392 and 2.0.0-p0:
rvm get head --autolibs=3
rvm install 1.9.3 --with-opt-dir=/usr/bin
rvm install 2.0.0
There was something not working with my mac ports and openssl and make and configure. This was the only way I was able to get rvm to install ruby again with out getting openssl issues or make/configure issues.
The new way to do it, according to a comment by #Purplejacket above, is the following:
rvm autolibs homebrew
rvm install 2.1.1
rvm use 2.1.1
It's much easier.
In my case:
Problem: After installing ruby-2.3.1, I ran the command bundle install and then the error occurred.
Solution:
I first installed OpenSSL on my machine. $ brew install openssl
And then, reinstalled the ruby version I require (2.3.1) with the openssl.
$ rvm reinstall 2.3.1 --with-openssl-dir=/usr/local/opt/openssl
And this solved my problem!
According to the following question:
How to tell which openssl lib is actually being used by an RVM-installed ruby
It seems that the options --with-openssl-dir=... is no longer valid as of Ruby 1.9.3. I tried
rvm install 1.9.3 --with-opt-dir=/usr/local --with-openssl
and it worked.
macOS Catalina
brew install rbenv/tap/openssl#1.0
rvm reinstall 2.3.8 --with-openssl-dir=/usr/local/opt/openssl#1.0
The following steps worked for me.
First ensure openssl is installed by running brew install openssl, then reinstall the ruby version using rvm, but this time around, you have to pass the with-opt-dir flag pointing to the location where openssl was installed on your machine (use command which openssl to find this location).
rvm install 1.9.3-p392 --with-openssl-dir=/usr/local/opt/openssl
On macOS 10.14, Ruby 2.5.3, and OpenSSL 1.0.2n this worked for me:
./configure --with-openssl --with-openssl-dir=/usr/local/ssl
but I was only trying what the error messages were telling me:
*** Following extensions are not compiled:
openssl:
Could not be configured. It will not be installed.
/Users/brian/Desktop/Ruby/ruby-2.5.3/ext/openssl/extconf.rb:97: OpenSSL library could not be found. You might want to use --with-openssl-dir=<dir> option to specify the prefix where OpenSSL is installed.
Check ext/openssl/mkmf.log for more details.
*** Fix the problems, then remove these directories and try again if you want.
make[1]: *** [note] Error 1
I encountered this issue when working on a Ruby 2.2.3 application.
I had previously uninstalled the MySQL database server on my machine, since I did not need it. However, I still needed the mysql2 gem since my application was connecting to another application's MySQL database to pull data.
However, when I try to run the bundle command I get the error:
Could not load OpenSSL.
You must recompile Ruby with OpenSSL support or change the sources in your Gemfile from 'https' to 'http'. Instructions for compiling with OpenSSL using RVM are
available at rvm.io/packages/openssl.
Here's how I solved it:
The issue was caused by removing the libssl-dev library when I was uninstalling the MySQL database server on my machine and its libraries.
First I ran the command below to reinstall ruby since I installed it using rvm:
rvm reinstall ruby-2.2.3
This raised an error:
Making gemset ruby-2.2.3 pristine............................................./-
.'command gem pristine --extensions mysql2 --version 0.5.3' failed, you need to fix these gems manually.
.
Error running '__rvm_with ruby-2.2.3 gemset_pristine',
please read /home/promisepreston/.rvm/log/1630094455_ruby-2.2.3/gemset.pristine-ruby-2.2.3.log
Next, I tried to install the mysql2 gem:
gem install mysql2
Then I ran into this error:
Building native extensions. This could take a while...
ERROR: Error installing mysql2:
ERROR: Failed to build gem native extension.
mysql client is missing. You may need to 'sudo apt-get install libmariadb-dev', 'sudo apt-get install libmysqlclient-dev' or 'sudo yum install mysql-devel', and try again.
Finally, I installed the mysql client library using the command:
sudo apt-get install libmysqlclient-dev
Note: This also installs the libssl-dev library alongside.
And everything worked fine.
That's all.
That's what helped me:
rvm reinstall 2.5
brew tap raggi/ale
brew install openssl-osx-ca
brew services start openssl-osx-ca
Found this solution here: https://github.com/raggi/openssl-osx-ca#readme
I specified a more recent Ruby version in my Gemfile, then ran bundle install. All good now.
Specific case for ruby version 3.0.3
By default for brew and system and autolibs OpenSSL version is 3. Ruby 3.0.3 does not work with OpenSSL version 3 and ruby build silently ignores OpenSSL.
To build ruby properly use build options with OpenSSL 1 like this:
PKG_CONFIG_PATH=/usr/local/opt/openssl#1.1/lib/pkgconfig rvm reinstall 3.0.3 --with-openssl --with-openssl-lib=/usr/local/opt/openssl#1.1/lib --with-openssl-include=/usr/local/opt/openssl#1.1/include
Where path variables may be another - check your system.
Thanks to article Ruby 3.0.3 with OpenSSL using MacPorts and RVM
I got this to work on Ubuntu 22.04 by doing:
rvm pkg install openssl
...and adding --with-openssl-dir=$HOME/.rvm/usr to the rvm install command.
This doesn't seem particularly OS-specific and might work on Mac OS as well.
Fix which worked for me
rvm install 3.0.3 --with-openssl-dir=/opt/homebrew/etc/openssl#1.1
PS. Find the correct openssl location in your machine and install ruby pointing to that path like above, mentioning the brew installed openssl#3 path doesnot work.
I don't use rvm, and I don't want to. I had to install asdf in order to resolve what I used to be able to do with just homebrew & ruby.
Following this guide is the only thing that worked for me after following dozens of suggestions. I had to install asdf and update my .zshrc to include the following at the end of the doc:
eval "$(rbenv init - zsh)"
I'm on an Intel Mac running Monterey 12.2.1.

Failing while running `brew install

I am trying to re-install Nokogiri dependencies with homebrew following the steps described here. I had nokogiri working fine before, but had to remove macports to make some space on my mac.
Running into errors at the first step:
$ brew install libxml2 libxslt
Warning: Your Xcode (3.2.2) is outdated
Please install Xcode 3.2.6.
==> Downloading ftp://xmlsoft.org/libxml2/libxml2-2.8.0.tar.gz
Warning: Failed to create the file
Warning: /Library/Caches/Homebrew/libxml2-2.8.0.tar.gz
0.0%
curl: (23) Failed writing body (0 != 1448)
Error: Download failed: ftp://xmlsoft.org/libxml2/libxml2-2.8.0.tar.gz
Any idea how to fix this?
Is the warning about Xcode version significant?
The relevant message above seemed to be Warning: Failed to create the file.
Tried to create the /Library/Caches/Homebrew/libxml2-2.8.0.tar.gz file manually, and got a Permission denied error.
Changed the ownership of the folder to my username:group with
sudo chown <username>:<group> /Library/Caches/Homebrew/
With that change, the brew install step worked successfully!
Note: The answers to brew install mongodb error: Cowardly refusing to `sudo brew install' Mac OSX Lion helped in figuring out the problem.

Resources