Failing while running `brew install - ruby

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.

Related

brew install bash failing

Trying to get a more recent version of bash installed on my Mac using brew.
brew is installed and working fine. When I try to run:
brew install bash
however I get the following error:
==> Downloading https://gist.githubusercontent.com/jacknagel/d886531fb6623b60b2a
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
And indeed, there's nothing at:
https://gist.githubusercontent.com/jacknagel
Update your Homebrew formulae and try again: brew update.

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

Missing the OpenSSL lib?

I have been trying to install ruby 2.1.1 but when I run it in the terminal, this is what i get:
$rbenv install 2.1.1
Downloading yaml-0.1.6.tar.gz...
-> http://dqw8nmjcqpjn7.cloudfront.net/5fe00cda18ca5daeb43762b80c38e06e
Installing yaml-0.1.6...
Installed yaml-0.1.6 to /Users/nthulanemakgato/.rbenv/versions/2.1.1
Downloading ruby-2.1.1.tar.gz...
-> http://dqw8nmjcqpjn7.cloudfront.net/e57fdbb8ed56e70c43f39c79da1654b2
Installing ruby-2.1.1...
BUILD FAILED
Inspect or clean up the working tree at /var/folders/tj/_bd6whds6lb7wtn2m8ylwx7h0000gp/T/ruby-build.20140427221824.34053
Results logged to /var/folders/tj/_bd6whds6lb7wtn2m8ylwx7h0000gp/T/ruby- build.20140427221824.34053.log
Last 10 log lines:
io-console 0.4.2
json 1.8.1
minitest 4.7.5
psych 2.0.3
rake 10.1.0
rdoc 4.1.0
test-unit 2.1.1.0
installing rdoc: /Users/nthulanemakgato/.rbenv/versions/2.1.1/share/ri/2.1.0/system
installing capi-docs: /Users/nthulanemakgato/.rbenv/versions/2.1.1/share/doc/ruby
The Ruby openssl extension was not compiled. Missing the OpenSSL lib?
So I went on Google, searched and tried a few things like:
$brew link openssl --force
Linking /usr/local/Cellar/openssl/1.0.1f... Warning: Could not link openssl. Unlinking...
then i tried
$ brew update
error: unable to unlink old '.gitignore' (Permission denied) error: unable to create file CODEOFCONDUCT.md (Permission denied) error: unable to unlink old 'CONTRIBUTING.md' (Permission denied) error: unable to create file LICENSE.txt (Permission denied) error: unable to unlink old 'README.md' (Permission denied) error: unable to unlink old 'SUPPORTERS.md' (Permission denied) Checking out files: 100% (1995/1995), done. Error: Failure while executing: git pull - q origin refs/heads/master:refs/remotes/origin/master
$ brew upgrade ruby-build
Error: ruby-build not installed
and,
$brew install openssl
==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/openssl- 1.0.1g.mavericks.bottle.tar.gz
######################################################################## 100.0%
==> Pouring openssl-1.0.1g.mavericks.bottle.tar.gz
==> Caveats
A CA file has been bootstrapped using certificates from the system
keychain. To add additional certificates, place .pem files in
/usr/local/etc/openssl/certs
and run
/usr/local/opt/openssl/bin/c_rehash
This formula is keg-only, so it was not symlinked into /usr/local.
Mac OS X already provides this software and installing another version in
parallel can cause all kinds of trouble.
The OpenSSL provided by OS X is too old for some software.
Generally there are no consequences of this for you. If you build your
own software and it requires this formula, you'll need to add to your
build variables:
LDFLAGS: -L/usr/local/opt/openssl/lib
CPPFLAGS: -I/usr/local/opt/openssl/include
Error: Failed to create: /usr/local/opt/openssl
Things that depend on openssl will probably not build.
==> Summary
🍺 /usr/local/Cellar/openssl/1.0.1g: 429 files, 15M
and lastly,
$sudo brew install openssl
Password:
Error: Cowardly refusing to `sudo brew install`
You can use brew with sudo, but only if the brew executable is owned by root.
However, this is both not recommended and completely unsupported so do so at
your own risk.
and a couple of other things like(which details I won't go into unless you think its necessary):
$CONFIGURE_OPTS="--with-openssl-dir=/usr/local/opt/openssl" rbenv install 2.1.1
$CFLAGS='-g -O2' RUBY_CONFIGURE_OPTS=--with-openssl-dir=`brew --prefix openssl` rbenv install 2.1.1
and both haven't worked.
I have installed xcode
I have an OS X 10.9.2.
Homebrew is installed.
OpenSSL 0.9.8y 5 Feb 2013
I don't understand what's going on and I have been struggling with this for a long time, please help.
Let me know if there is more information that you need in order to help and i'll happily provide it.
I found the answer to this challenge in another site.
$rbenv install --patch 2.1.1
then
$curl https://gist.githubusercontent.com/andschwa/11334511/raw/563d5c2efb869cafb0c65404d12243822bba2817/ruby-2.1.1-readline.patch | rbenv install --patch 2.1.1
I got this information from this link:
https://schwartzmeyer.com/2014/04/26/building-ruby-2-0-0-and-2-1-1-on-os-x/

Could not install Ruby 2.0 because Openssl.org down?

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.

Resources