Using rbenv install throws an error - ruby

I'm using Homebrew rbenv. brew doctor comes out fine. rbenv install 2.0.0-p451 gives the following error message:
user$ rbenv install 2.0.0-p451
Downloading ruby-2.0.0-p451.tar.gz...
-> http://dqw8nmjcqpjn7.cloudfront.net/9227787a9636551f1749ee8394b5ffe5
Installing ruby-2.0.0-p451...
BUILD FAILED
Inspect or clean up the working tree at /var/folders/4h/ty8nj6c144b5cmhcrt0hd3cw0000gn/T/ruby-build.20140501101240.6245
Results logged to /var/folders/4h/ty8nj6c144b5cmhcrt0hd3cw0000gn/T/ruby-build.20140501101240.6245.log
Last 10 log lines:
ld: warning: directory not found for option '-L/usr/local/var/rbenv/versions/2.0.0-p451/lib'
installing default openssl libraries
1 warning generated.
linking shared-object date_core.bundle
ld: warning: directory not found for option '-L/usr/local/var/rbenv/versions/2.0.0-p451/lib'
linking shared-object openssl.bundle
ld: warning: directory not found for option '-L/usr/local/var/rbenv/versions/2.0.0-p451/lib'
linking shared-object ripper.bundle
ld: warning: directory not found for option '-L/usr/local/var/rbenv/versions/2.0.0-p451/lib'
make: *** [build-ext] Error 2
I tried googling it but not luck. Any tips?
p.s. I tried other ruby versions but same issue (although the last 10 lines of the log are slightly different).
Edit: installing version 1.9.3-p545 works fine.

brew cleanup and remove this /var/folders/4h/ty8nj6c144b5cmhcrt0hd3cw0000gn/T/ruby-build.20140501101240.6245 file.
I remember i removed all /var/folders/4h folder (wasn't exactly such name, but then i removed all folders in /var/folders/ and there wasn't no problem).

Related

OpenCV OS X 10.12sierra

'QTKit/QTKit.h' file not found
#import <QTKit/QTKit.h>
^
1 error generated.
make[2]: *** [modules/videoio/CMakeFiles/opencv_videoio.dir/src/cap_qtkit.mm.o] Error 1
make[1]: *** [modules/videoio/CMakeFiles/opencv_videoio.dir/all] Error 2
make: *** [all] Error 2
JefferydeMacBook-Pro:build jefferyfan$ cd ~
JefferydeMacBook-Pro:~ jefferyfan$ brew install QTKit
Error: No available formula with the name "qtkit"
==> Searching for similarly named formulae...
Error: No similarly named formulae found.
==> Searching taps...
Error: No formulae found in taps.
This error shows up.
and Homebrew have problems as well.
Just use
brew install opencv3 --HEAD --with-contrib
It works fine for me.
In macOS 10.12, apple removed most of QTKit's components, include some functions and header files opencv use, so opencv 3 can't compile on macOS 10.12 (eg. header file "QTKit/QTKit.h" file has been removed, which is included in "cap_qtkit.mm").
Source
Currently the only way to compile OpenCV on Sierra is to disable the modules using QTKit. Just add this flag when you run cmake to disable it.
cmake -DBUILD_opencv_videoio=OFF

Cannot install Ruby 1.9.3-p194 via RBEnv due SSL_OP_MSIE_SSLV2_RSA_PADDING undeclared

I try to install Ruby on a clean server.
Server was a Debian 6.0.9 which I upgraded to Debian 7.5
I've installed RBEnv with build-support via apt-get install.
When I try to install Ruby 1.9.3-p194 (summed in the list via ruby-build --definitions), I got an error the installation failed.
When I check the error in the log file, I got next error:
make[2]: Entering directory `/tmp/ruby-build.20140610073619.8858/ruby-1.9.3-p194/ext/openssl'
compiling ossl_pkey_rsa.c
compiling ossl_asn1.c
compiling callback-4.c
compiling ossl_x509.c
compiling ossl_pkcs5.c
compiling ossl_x509crl.c
compiling ossl_rand.c
compiling ossl_pkey_dsa.c
compiling ossl_x509cert.c
compiling ossl_ssl_session.c
compiling ossl_config.c
compiling callback-5.c
compiling ossl_engine.c
compiling ossl_pkey_ec.c
compiling ossl_bn.c
compiling ossl_x509name.c
compiling ossl_ssl.c
ossl_ssl.c: In function 'Init_ossl_ssl':
ossl_ssl.c:1982:5: error: 'SSL_OP_MSIE_SSLV2_RSA_PADDING' undeclared (first use in this function)
ossl_ssl.c:1982:5: note: each undeclared identifier is reported only once for each function it appears in
make[2]: *** [ossl_ssl.o] Error 1
make[2]: Leaving directory `/tmp/ruby-build.20140610073619.8858/ruby-1.9.3-p194/ext/openssl'
make[1]: *** [ext/openssl/all] Error 2
make[1]: *** Waiting for unfinished jobs....
compiling callback-6.c
compiling callback-7.c
compiling callback-8.c
linking shared-object dl/callback.so
make[2]: Leaving directory `/tmp/ruby-build.20140610073619.8858/ruby-1.9.3-p194/ext/dl/callback'
make[1]: Leaving directory `/tmp/ruby-build.20140610073619.8858/ruby-1.9.3-p194'
make: *** [build-ext] Error 2
I've installed/updated the openSSL version (OpenSSL 1.0.1e 11 Feb 2013) and installed libssl-dev, but the error stays.
Anyone an idea what I'm missing to have SSL_OP_MSIE_SSLV2_RSA_PADDING declared?
Is this an error in the Ruby-installation, or do I have a setup issue somewhere else?
All advice is welcome :)
(I already spend some time googling this, search on lot of sites, I guess I'm looking for the wrong solutions..)
-- Edit:
I found Ruby 2.1 fails to install due to OpenSSL error where it said the macro is removed in latest OPEN_SSL, does this mean I cannot use Ruby 1.9.x anymore? When I list ruby versions available via rbenv, no stable ruby 2 is listed + I prefer to keep using Ruby 1.9. Should I downgrade open_ssl (not wise idea) or ?
It looks like the define was dropped sometime after 1.0.1e-2+deb7u6, certainly is not present in 1.0.1e-2+deb7u10.
I worked around this by adding
#define SSL_OP_MSIE_SSLV2_RSA_PADDING 0x00000040L /* no effect since 0.9.7h and 0.9.8b */
back to /usr/include/openssl/ssl.h. (Picked from 1.0.1e-2+deb7u6)
Do at your own risk, I have not investigated what will happen if that value is passed.

Troubleshooting optipng install with brew install optipng

I've been having a go at this issue the whole evening on my mac terminal window. I'm having difficulty installing optipng with 'brew install optipng' on my mac.
Here is a log from terminal after 'brew install optipng'
==> Downloading https://downloads.sourceforge.net/project/optipng/OptiPNG/optipn
Already downloaded: /Library/Caches/Homebrew/optipng-0.7.5.tar.gz
==> ./configure --with-system-zlib --prefix=/usr/local/Cellar/optipng/0.7.5 --ma
==> make install
_main in optipng.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [optipng] Error 1
make: *** [install] Error 2
READ THIS: https://github.com/Homebrew/homebrew/wiki/troubleshooting
Naturally, I followed the link to github, and tried getting somewhere with brew doctor, instructions suggested by brew doctor, and even brew update.
I will include some of the warnings from brew doctor here, and will follow up with the whole log if need be (I don't want to clog up the post with unnecessary info).
Warning: gettext files detected at a system prefix
These files can cause compilation and link failures, especially if they
are compiled with improper architectures. Consider removing these files:
/usr/local/lib/libintl.dylib
Warning: Your XQuartz (2.7.4) is outdated
Please install XQuartz 2.7.5:
https://xquartz.macosforge.org
Warning: Python is installed at /Library/Frameworks/Python.framework
Warning: You have MacPorts or Fink installed:
/opt/local/bin/port
Warning: Unbrewed dylibs were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.
Warning: Unbrewed .la files were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.
Warning: Unbrewed static libraries were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.
Any help would greatly be appreciated.
Thanks
This one was really frustrating for me, but I managed to resolve the homebrew doctor issues, heres how:
Warning: Python is installed at /Library/Frameworks/Python.framework
I had multiple versions of Python installed, so I went ahead and deleted this one with:
sudo rm -rf /Library/Frameworks/Python.framework
Warning: You have MacPorts or Fink installed:
This one was a lot more difficult, my Macports had a PATH issues, so I had to add the path where it was located with terminal, then delete it from there.
Warning: Unbrewed dylibs were found in /usr/local/lib.
I deleted these with rm on terminal.
Warning: Unbrewed .la files were found in /usr/local/lib.
Deleted.
Unbrewed static libraries were found in /usr/local/lib.
If i'm not mistaken, I did brew prune here.
There was also changing the permissions in all my PATH files from root to me.
After doing this optipng installed fine.

'rbenv install 2.0.0-p247' fails

i already discussed this issue with the maintainer of ruby-build and followed his advice by googling for similar errors. i found similar ones but they do not seem to match my specific problem:
i'm trying to install ruby with rbenv install 2.0.0-p247 (using the ruby-build plugin) on archlinux – but the command fails.
here the last 10 log lines:
rbconfig.rb updated
generating enc.mk
compiling dln.c
compiling encoding.c
generating prelude.c
compiling prelude.c
linking static-library libruby-static.a
verifying static-library libruby-static.a
collect2: error: ld returned 1 exit status
make: *** [libruby-static.a] Error 1
i would appreciate any hints on this problem – thanks!
To find out what's wrong here, the best bet is to run the Ruby installation yourself to see exactly what's amiss. ruby-build typically downloads and extracts Ruby in /tmp (it should be the same path where it also saves the log file of the failed install).
Go to that directory and run:
$ ./configure
$ make
To see if you get the same error. If you do, then try to re-run the command that failed again. In your case this is probably:
$ ranlib libruby-static.a
To see why it fails.

Trying to install opencv using homebrew. ERROR: modules/highgui/CMakeFiles/opencv_highgui.dir/all Error 2

I have mac, os x 10.8.3
I used to have macports installed, I deleted it and trying to install opencv using Homebrew.
I installed lame, ffmpeg. Changed $PATH. The error is still the same:
Nellys-MacBook-Pro:~ nellysmitt$ brew install opencv
==> Downloading http://sourceforge.net/projects/opencvlibrary/files/opencv-unix/
Already downloaded: /Library/Caches/Homebrew/opencv-2.4.5.tar.gz
==> cmake -DCMAKE_INSTALL_PREFIX=/usr/local/Cellar/opencv/2.4.5 -DCMAKE_BUILD_TY
==> make
[ 38%] Building CXX object modules/highgui/CMakeFiles/opencv_highgui.dir/src/grfmt_tiff.cpp.o
Linking CXX shared library ../../lib/libopencv_video.dylib
[ 38%] Built target opencv_video
make[1]: *** [modules/highgui/CMakeFiles/opencv_highgui.dir/all] Error 2
make: *** [all] Error 2
READ THIS: https://github.com/mxcl/homebrew/wiki/troubleshooting
Brew doctor was ok before installing ffmpeg. NOw it tells:
Nellys-MacBook-Pro:~ nellysmitt$ brew doctor
Warning: Unbrewed dylibs were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.
Unexpected dylibs:
/usr/local/lib/libavcodec.52.108.0.dylib
/usr/local/lib/libavcore.0.16.1.dylib
/usr/local/lib/libavdevice.52.2.3.dylib
/usr/local/lib/libavfilter.1.74.0.dylib
/usr/local/lib/libavformat.52.93.0.dylib
/usr/local/lib/libavutil.50.36.0.dylib
/usr/local/lib/libmp3lame.0.dylib
/usr/local/lib/libswscale.0.12.0.dylib
Warning: Unbrewed .la files were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.
Unexpected .la files:
/usr/local/lib/libmp3lame.la
Warning: Unbrewed .pc files were found in /usr/local/lib/pkgconfig.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.
Unexpected .pc files:
/usr/local/lib/pkgconfig/libavcodec.pc
/usr/local/lib/pkgconfig/libavcore.pc
/usr/local/lib/pkgconfig/libavdevice.pc
/usr/local/lib/pkgconfig/libavfilter.pc
/usr/local/lib/pkgconfig/libavformat.pc
/usr/local/lib/pkgconfig/libavutil.pc
/usr/local/lib/pkgconfig/libswscale.pc
Warning: Unbrewed static libraries were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.
Unexpected static libraries:
/usr/local/lib/libavcodec.a
/usr/local/lib/libavcore.a
/usr/local/lib/libavdevice.a
/usr/local/lib/libavfilter.a
/usr/local/lib/libavformat.a
/usr/local/lib/libavutil.a
/usr/local/lib/libmp3lame.a
/usr/local/lib/libswscale.a
But the ERROR is the SAME for the last 24 hours. I'm mad and desperate. Don't know how to install this damn OpenCV.
This worked for me Oct 2013:
first brew update to be sure homebrew is current
then brew doctor and be sure homebrew reports no issues
Then, brew tap homebrew/science to point to latest opencv
Then brew install opencv
Best of luck!

Resources